Skip to content

Commit d195384

Browse files
committed
final
1 parent a2e42d7 commit d195384

38 files changed

+129
-6
lines changed

App.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11

22
import {createNativeStackNavigator} from "@react-navigation/native-stack";
3-
import {NavigationContainer} from "@react-navigation/native";
3+
import {createNavigationContainerRef, NavigationContainer} from "@react-navigation/native";
44
import {HomePage} from "./Screens/HomePage";
55
import ContextState from "./Context/ContextState";
66
import {ChatPage} from "./Screens/ChatPage";
77
import {MailPage} from "./Screens/MailPage";
88
import {CodePage} from "./Screens/CodePage";
99
import {ToastProvider} from "react-native-toast-notifications";
1010
import {HistoryChatPage} from "./Screens/HistoryChatPage";
11+
import {OnboardingScreen} from "./Screens/OnboardingScreen";
12+
import {useEffect, useState} from "react";
13+
import AsyncStorage from "@react-native-async-storage/async-storage";
14+
import {Initial} from "./Screens/Initial";
1115

1216

1317
function App(): JSX.Element {
14-
1518
const Stack = createNativeStackNavigator()
16-
17-
1819
return (<ToastProvider>
1920
<ContextState>
20-
<NavigationContainer>
21-
<Stack.Navigator>
21+
<NavigationContainer >
22+
<Stack.Navigator initialRouteName={'Initial'}>
23+
<Stack.Screen name={"Initial"} component={Initial} options={{
24+
headerShown:false
25+
}}/>
26+
<Stack.Screen name={"Onboarding"} component={OnboardingScreen} options={{
27+
headerShown:false
28+
}}/>
2229
<Stack.Screen name={"HomePage"} component={HomePage} options={{
2330
headerShown:false
2431
}}/>

Assets/code.gif

2.51 MB
Loading

Assets/logo.jpg

3.66 MB
Loading

Assets/mail.gif

292 KB
Loading

Assets/preview.png

-121 KB
Binary file not shown.

Screens/Initial.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import AsyncStorage from "@react-native-async-storage/async-storage";
2+
import {useContext, useEffect} from "react";
3+
import {View} from "react-native";
4+
import Context from "../Context/Context";
5+
6+
export const Initial = ({navigation}) => {
7+
const {Style1}=useContext(Context)
8+
async function Get(){
9+
const val=await AsyncStorage.getItem('On');
10+
console.log(val)
11+
if(val==='T'){
12+
navigation.replace('HomePage')
13+
14+
}else{
15+
navigation.replace('Onboarding')
16+
}
17+
}
18+
useEffect(() => {
19+
Get()
20+
}, []);
21+
return (
22+
<View style={{
23+
backgroundColor:"black",
24+
flex:1
25+
}}></View>
26+
)
27+
}

Screens/OnboardingScreen.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import Onboarding from 'react-native-onboarding-swiper';
2+
import {Image} from "react-native";
3+
import AsyncStorage from "@react-native-async-storage/async-storage";
4+
5+
export const OnboardingScreen = ({navigation}) => {
6+
return (
7+
<Onboarding
8+
skipToPage={3}
9+
titleStyles={{
10+
fontSize:30
11+
}}
12+
onDone={async ()=>{
13+
await AsyncStorage.setItem('On', "T");
14+
navigation.replace("HomePage")
15+
}}
16+
pages={[
17+
{
18+
backgroundColor: '#045d8d',
19+
image: <Image source={require('../Assets/logo.jpg')} style={{
20+
height:200,
21+
width:200,
22+
borderRadius:10
23+
}}/>,
24+
title: 'Welcome to O2.Ai',
25+
subtitle: 'Your personal Ai assistant',
26+
},
27+
{
28+
backgroundColor: '#f1af85',
29+
image: <Image source={require('../Assets/mail.gif')} style={{
30+
height:200,
31+
width:200,
32+
borderRadius:1500
33+
}}/>,
34+
title: 'Mail Generation',
35+
subtitle: 'Generate professional mails with just one tap',
36+
},
37+
{
38+
backgroundColor: '#e9bcbe',
39+
image: <Image source={require('../Assets/code.gif')} style={{
40+
height:200,
41+
width:200,
42+
borderRadius:1500
43+
}}/>,
44+
title: 'Code Generation',
45+
subtitle: 'A professional coder at your finger tip.',
46+
},
47+
{
48+
backgroundColor: '#c1c1f1',
49+
title: 'Let\'s Go !',
50+
subtitle:""
51+
},
52+
]}
53+
/>
54+
)
55+
}
157 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background"/>
4+
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
5+
</adaptive-icon>

0 commit comments

Comments
 (0)