-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
38 lines (28 loc) · 870 Bytes
/
App.tsx
File metadata and controls
38 lines (28 loc) · 870 Bytes
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
import Clock from './components/Clock';
import Weather from './components/Weather';
import React from 'react';
import * as ScreenOrientation from 'expo-screen-orientation';
import { View, Text, StatusBar } from 'react-native';
import './global.css';
export default function App() {
// Force orientation to landscape
async function changeOrientation() {
await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE);
};
const [time, setTime] = React.useState(new Date().toLocaleTimeString());
function refreshTime() {
setInterval(() => {
setTime(new Date().toLocaleTimeString());
}, 1000);
}
React.useEffect(() => {
refreshTime();
}, []);
return (
<View className='bg-background flex-1 items-center justify-center'>
<StatusBar hidden />
<Clock />
<Weather />
</View>
);
}