-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathApp.tsx
51 lines (46 loc) · 1.07 KB
/
App.tsx
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { StatusBar } from "expo-status-bar";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import Constants from "expo-constants";
import faker from "faker";
import List from "./components/list";
faker.seed(26);
interface data {
name: string;
email: string;
job_title: string;
key: string;
avatar: string;
}
export default function App() {
const fake: string[] = new Array(40).fill("test");
const data: data[] = fake.map(() => ({
name: faker.name.findName(),
job_title: faker.name.jobTitle(),
email: faker.internet.email(),
key: faker.random.alphaNumeric(10),
avatar: faker.image.avatar(),
}));
return (
<View style={styles.container}>
<StatusBar style="auto" />
<Text
style={{
marginTop: 10,
fontSize: 30,
fontWeight: "bold",
marginLeft: 20,
}}
>
FlatList
</Text>
<List data={data} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: Constants.statusBarHeight,
},
});