-
Notifications
You must be signed in to change notification settings - Fork 463
Expand file tree
/
Copy pathutils.ts
More file actions
33 lines (30 loc) · 1.06 KB
/
utils.ts
File metadata and controls
33 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import type { ViewStyle } from 'react-native';
export const PAGES = 5;
export const BGCOLOR = ['#fdc08e', '#fff6b9', '#99d1b7', '#dde5fe', '#f79273'];
export const IMAGE_URIS = [
'https://apod.nasa.gov/apod/image/1410/20141008tleBaldridge001h990.jpg',
'https://apod.nasa.gov/apod/image/1409/volcanicpillar_vetter_960.jpg',
'https://apod.nasa.gov/apod/image/1409/m27_snyder_960.jpg',
'https://apod.nasa.gov/apod/image/1409/PupAmulti_rot0.jpg',
'https://apod.nasa.gov/apod/image/1510/lunareclipse_27Sep_beletskycrop4.jpg',
];
export const thumbsUp = '\uD83D\uDC4D';
export const logoUrl =
'https://raw.githubusercontent.com/callstack/react-native-pager-view/master/img/viewpager-logo.png';
export type CreatePage = {
key: number;
style: ViewStyle;
imgSource: { uri: string };
};
export const createPage = (key: number): CreatePage => {
return {
key: key,
style: {
flex: 1,
backgroundColor: BGCOLOR[key % BGCOLOR.length],
alignItems: 'center',
padding: 20,
},
imgSource: { uri: IMAGE_URIS[key % BGCOLOR.length] || '' },
};
};