-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
43 lines (39 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
import React, { useEffect, useState } from 'react';
import { Text, View } from 'react-native';
import { Video } from 'expo-av';
import ponei from './assets/ponei.mp4';
import poneiStatic from './assets/ponei-static.jpg';
import estilos from './App.css'
export default function App() {
const [date, setDate] = useState(new Date().toLocaleTimeString())
function clock() {
setDate(new Date().toLocaleTimeString())
}
useEffect(() => {
setTimeout(() => {
clock()
}, 1000)
})
return (
<View style={estilos.container}>
<Text style={estilos.texto}>Relógio ⏰</Text>
<Text>{'\n'}</Text>
<Text testID="clock" style={estilos.texto}>{date}</Text>
<View style={estilos.videoViewStyle}>
<Video
source={ponei}
style={estilos.video}
rate={1.0}
volume={1.0}
useNativeControls
isMuted={false}
resizeMode="cover"
isLooping
posterSource={poneiStatic}
posterStyle={estilos.posterStyle}
usePoster
/>
</View>
</View>
)
}