-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathApp.js
34 lines (31 loc) · 874 Bytes
/
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
import React, {useState} from 'react';
import {View, Text, Button, StyleSheet} from 'react-native';
import DatePicker from 'react-native-date-picker';
import Notifications from './Notifications';
export default function App() {
const [date, setDate] = useState(new Date());
const setNotification = () => {
// Notifications.schduleNotification(date);
Notifications.schduleNotification(new Date(Date.now() + 5 * 1000));
};
return (
<View style={styles.container}>
{/* <DatePicker date={date} onDateChange={setDate} /> */}
<View style={styles.wrapper} />
<Button
title="Set notification after 5 seconds"
onPress={setNotification}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
wrapper: {
height: 60,
},
});