diff --git a/app.json b/app.json index eeb2429..49cd422 100644 --- a/app.json +++ b/app.json @@ -4,7 +4,7 @@ "slug": "mobilemkv2", "version": "1.0.0", "orientation": "portrait", - "icon": "./assets/images/phone.png", + "icon": "./assets/images/bad.png", "scheme": "myapp", "userInterfaceStyle": "automatic", "newArchEnabled": true, diff --git a/app/(root)/(tabs)/_layout.tsx b/app/(root)/(tabs)/_layout.tsx new file mode 100644 index 0000000..26ee597 --- /dev/null +++ b/app/(root)/(tabs)/_layout.tsx @@ -0,0 +1,67 @@ +import {View, Text, Image} from 'react-native' +import React from 'react' +import {Tabs} from "expo-router"; +import icons from "@/constants/icons" + +const TabIcon = ({focused, icon, title }: {focused: boolean, icon: any, title: string}) => ( + + + {title} + +) + +const TabsLayout = () => { + // @ts-ignore + return ( + + ( + + ) + + }} + /> + + ( + + ) + + }} + /> + + ( + + ) + + }} + /> + + ) +} +export default TabsLayout diff --git a/app/(root)/(tabs)/explore.tsx b/app/(root)/(tabs)/explore.tsx index 40707e3..4afbd25 100644 --- a/app/(root)/(tabs)/explore.tsx +++ b/app/(root)/(tabs)/explore.tsx @@ -4,7 +4,7 @@ import React from "react"; const Explore = () => { return ( - SignIn + explore ); }; diff --git a/app/(root)/(tabs)/index.tsx b/app/(root)/(tabs)/index.tsx index c2cbb80..cc0f4e0 100644 --- a/app/(root)/(tabs)/index.tsx +++ b/app/(root)/(tabs)/index.tsx @@ -11,10 +11,10 @@ export default function Index() { }} > Welcome to mobile.mk - SignIn - explore - profile - car + {/*SignIn*/} + {/*explore*/} + {/*profile*/} + {/*car*/} ); } diff --git a/app/(root)/(tabs)/profile.tsx b/app/(root)/(tabs)/profile.tsx index de32b5c..6a0f09b 100644 --- a/app/(root)/(tabs)/profile.tsx +++ b/app/(root)/(tabs)/profile.tsx @@ -1,11 +1,30 @@ -import { View, Text } from "react-native"; +import {View, Text, SafeAreaView, ScrollView, Image, TouchableOpacity} from "react-native"; import React from "react"; +import icons from "@/constants/icons" +import images from "@/constants/images"; const Profile = () => { + const handleLogout = async () => {}; return ( - - profile - + + + + Profile + + + + + + + + + Dimitar -- test + + + + ); }; diff --git a/app/(root)/_layout.tsx b/app/(root)/_layout.tsx new file mode 100644 index 0000000..5a8bb2f --- /dev/null +++ b/app/(root)/_layout.tsx @@ -0,0 +1,19 @@ +import {useGlobalContext} from "@/lib/globalProvider"; +import {ActivityIndicator, SafeAreaView} from "react-native"; +import React from "react"; +import {Redirect, Slot} from "expo-router"; + +export default function AppLayout() { + const { loading, isLoggedIn} = useGlobalContext(); + + if (loading) { + return ( + + + + ) + + } + if(!isLoggedIn) return + return +} \ No newline at end of file diff --git a/app/signin.tsx b/app/signin.tsx index 06815e0..5d1f101 100644 --- a/app/signin.tsx +++ b/app/signin.tsx @@ -4,12 +4,15 @@ import images from "@/constants/images"; import icons from "@/constants/icons"; import {login} from "@/lib/appwrite"; import {useGlobalContext} from "@/lib/globalProvider"; +import {Redirect} from "expo-router"; const SignIn = () => { const {refetch, loading, isLoggedIn} = useGlobalContext(); + if(!loading && isLoggedIn) return ; const handleLogin = async () => { const result = await login(); if (result) { + await refetch(); console.log('logon successful'); } else { Alert.alert('Login failed') diff --git a/constants/images.ts b/constants/images.ts index 0a373b2..3566475 100644 --- a/constants/images.ts +++ b/constants/images.ts @@ -17,5 +17,5 @@ export default { car1, car2, onboarding, - collage + collage, };