Skip to content

Commit

Permalink
[REFACTORING] Regrouping the end
Browse files Browse the repository at this point in the history
  • Loading branch information
JustalK committed Dec 12, 2020
1 parent 54ba4ed commit 6387d5d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
13 changes: 2 additions & 11 deletions src/pages/Listing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
NativeScrollSize,
NativeScrollPoint,
} from 'react-native';
import { styleMain } from '../styles/main';
import { styleMain, stylePage } from '../styles/main';
import { colors } from '../styles/colors';
import Project from '../components/Project';
import Loading from '../components/Loading';
Expand Down Expand Up @@ -73,7 +73,7 @@ export default class Portfolio extends Component<ListingProps, ListingStates> {
}

renderEndOfPage(): JSX.Element {
return <Text style={styles.end}>You have reached the bottom of the page</Text>;
return <Text style={stylePage.end}>You have reached the bottom of the page</Text>;
}

renderLoadingMore(): JSX.Element {
Expand Down Expand Up @@ -136,15 +136,6 @@ export default class Portfolio extends Component<ListingProps, ListingStates> {
}

const styles = StyleSheet.create({
end: {
fontSize: 20,
fontFamily: 'LatoLight',
textAlign: 'center',
color: colors.cyan,
alignSelf: 'center',
marginTop: 50,
marginBottom: 100,
},
loaderPadding: {
padding: 100,
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/ProjectZoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Slide from '../components/Slide';
import Title from '../components/Title';
import Description from '../components/Description';
import {FIRST_ID_PROJECT} from '../libs/constants';
import { styleMain } from '../styles/main';
import { styleMain, stylePage } from '../styles/main';
import ApiProject from '../services/ApiProject';
import ApiSlide from '../services/ApiSlide';
import { ProjectZoomProps, ProjectZoomStates } from '../interfaces/ProjectZoom';
Expand Down Expand Up @@ -68,7 +68,7 @@ export default class ProjectZoom extends Component<ProjectZoomProps, ProjectZoom
}

renderEndOfPage(): JSX.Element {
return <Text style={styles.end}>You have reached the bottom of the page</Text>;
return <Text style={stylePage.end}>You have reached the bottom of the page</Text>;
}

renderLoadingMore(): JSX.Element {
Expand Down
12 changes: 12 additions & 0 deletions src/styles/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ export const styleMain = StyleSheet.create({
padding: 20,
},
});

export const stylePage = StyleSheet.create({
end: {
fontSize: 20,
fontFamily: 'LatoLight',
textAlign: 'center',
color: colors.cyan,
alignSelf: 'center',
marginTop: 50,
marginBottom: 100,
}
});

0 comments on commit 6387d5d

Please sign in to comment.