-
Notifications
You must be signed in to change notification settings - Fork 225
Expand file tree
/
Copy pathApp.tsx
More file actions
57 lines (52 loc) · 1.24 KB
/
App.tsx
File metadata and controls
57 lines (52 loc) · 1.24 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<% if (project.view) { -%>
import { StyleSheet, View } from 'react-native';
import { <%- project.name -%>View } from '<%- project.slug -%>';
<% } else { -%>
<% if (project.arch !== 'new') { -%>
import { useState, useEffect } from 'react';
<% } -%>
import { StyleSheet, View, Text } from 'react-native';
import { multiply } from '<%- project.slug -%>';
<% } -%>
<% if (project.view) { -%>
export default function App() {
return (
<View style={styles.container}>
<<%- project.name -%>View color="#32a852" style={styles.box} />
</View>
);
}
<% } else if (project.arch === 'new' && project.module) { -%>
const result = multiply(3, 7);
export default function App() {
return (
<View style={styles.container}>
<Text>Result: {result}</Text>
</View>
);
}
<% } else { -%>
export default function App() {
const [result, setResult] = useState<number | undefined>();
useEffect(() => {
multiply(3, 7).then(setResult);
}, []);
return (
<View style={styles.container}>
<Text>Result: {result}</Text>
</View>
);
}
<% } -%>
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
box: {
width: 60,
height: 60,
marginVertical: 20,
},
});