Skip to content

Commit 5611efc

Browse files
author
Neelesh Ranjan Jha
committed
add classes ui changed
1 parent 6a4ed1d commit 5611efc

File tree

11 files changed

+369
-328
lines changed

11 files changed

+369
-328
lines changed

App.js

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,77 @@
1-
import React from "react";
1+
import React, { useEffect } from "react";
22
import { NavigationContainer } from "@react-navigation/native";
3-
import { SafeAreaProvider} from "react-native-safe-area-context";
3+
import { SafeAreaProvider } from "react-native-safe-area-context";
4+
import AsyncStorage from "@react-native-async-storage/async-storage";
45

56
import RootNav from "./src/routes/rootNav";
67

78
export default function App() {
9+
10+
async function createEmptyStorage(){
11+
const monday = ["Monday", JSON.stringify({
12+
Theory: {
13+
Morning: {
14+
A1: {
15+
to: "08:00" , from: "08:50", subname: ""
16+
},
17+
F1: {
18+
to: "08:55" , from: "09:45", subname: ""
19+
},
20+
D1: {
21+
to: "09:50" , from: "10:40", subname: ""
22+
},
23+
TB1: {
24+
to: "10:45" , from: "11:35", subname: ""
25+
},
26+
TG1: {
27+
to: "11:40" , from: "12:30", subname: ""
28+
},
29+
},
30+
Evening: {
31+
A2: {
32+
to: "02:00" , from: "02:50", subname: ""
33+
},
34+
F2: {
35+
to: "02:55" , from: "03:45", subname: ""
36+
},
37+
D2: {
38+
to: "03:50" , from: "04:40", subname: ""
39+
},
40+
TB2: {
41+
to: "04:45" , from: "05:35", subname: ""
42+
},
43+
TG2: {
44+
to: "05:40" , from: "06:30", subname: ""
45+
},
46+
}
47+
}
48+
})
49+
]
50+
try{
51+
await AsyncStorage.multiSet([monday])
52+
console.log('default values set')
53+
} catch(e){
54+
console.log(e)
55+
}
56+
}
57+
58+
useEffect(() => {
59+
async function checkEmpty() {
60+
await AsyncStorage.getAllKeys()
61+
.then((res) => {
62+
if(res.length == 0)
63+
createEmptyStorage();
64+
})
65+
.catch((e) => console.log(e));
66+
}
67+
checkEmpty();
68+
}, []);
69+
870
return (
971
<NavigationContainer>
10-
<SafeAreaProvider>
11-
<RootNav />
12-
</SafeAreaProvider>
72+
<SafeAreaProvider>
73+
<RootNav />
74+
</SafeAreaProvider>
1375
</NavigationContainer>
1476
);
15-
}
77+
}

app.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"version": "1.0.0",
66
"orientation": "portrait",
77
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "automatic",
89
"splash": {
910
"image": "./assets/splash.png",
1011
"resizeMode": "contain",

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"dependencies": {
1111
"@react-native-async-storage/async-storage": "~1.15.0",
12+
"@react-native-community/datetimepicker": "3.5.2",
1213
"@react-native-picker/picker": "1.16.1",
1314
"@react-navigation/material-top-tabs": "^6.0.2",
1415
"@react-navigation/native": "^6.0.2",
@@ -18,8 +19,8 @@
1819
"react": "16.13.1",
1920
"react-dom": "16.13.1",
2021
"react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",
21-
"react-native-appearance": "~0.3.3",
2222
"react-native-elements": "^3.4.2",
23+
"react-native-modal-datetime-picker": "^10.2.0",
2324
"react-native-pager-view": "5.0.12",
2425
"react-native-responsive-screen": "^1.4.2",
2526
"react-native-safe-area-context": "3.2.0",

src/components/AddSlot/index.jsx

Lines changed: 0 additions & 250 deletions
This file was deleted.

0 commit comments

Comments
 (0)