-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
63 lines (53 loc) · 1.7 KB
/
App.js
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
58
59
60
61
62
63
import React from 'react';
import { StyleSheet, Text, View, ScrollView, Dimensions } from 'react-native';
import Header from './components/Header'
import HomeData from './components/HomeData'
import { useState, useEffect } from "react";
import colors from './components/config/colors.js'
export default function App() {
const [dta, setDt] = useState(new Date().toLocaleString());
useEffect(() => {
let secTimer = setInterval( () => {
setDt(new Date().toLocaleString())
},1000)
return () => clearInterval(secTimer);
}, []);
// console.log("hi")
return (
<View style={styles.container}>
<ScrollView>
<Header/>
<View style={styles.dateTimeStyle}>
{/* <Text style={styles.dateTimeTextStyle}>{Date().getDate() + '/' + Date().getMonth() + '/' + Date().getFullYear() + ' ' + Date().getHours() + ':' + Date().getMinutes() + ':' + Date().getSeconds()}</Text> */}
<Text style={styles.dateTimeTextStyle}>•{dta}•</Text>
</View>
<HomeData/>
{/* <Text>Open up App.js to start working on your app test best !</Text> */}
</ScrollView>
</View>
);
}
const styles = StyleSheet.create({
container: {
// position : 'absolute',
height : '100%',
// flex: 1,
backgroundColor: colors.primary,
// alignItems: 'center',
// justifyContent: 'center',
},
dateTimeStyle: {
// position : 'absolute',
// height : '100%',
height: Dimensions.get('window').height/15,
// flex: 1,
// backgroundColor: colors.primary,
alignItems: 'center',
justifyContent: 'center',
},
dateTimeTextStyle: {
fontSize : 15,
fontWeight : '700',
color : colors.timeColor,
},
});