🔧 refactor(App.tsx, SignIn.tsx, SignUp.tsx, ClipElementLocal.tsx, ClipElementRemote.tsx, ClipList.tsx, ClipView.tsx, ClipViewLocal.tsx, ClipViewRemote.tsx, Auth.tsx, Clips.tsx, Intro.tsx, Settings.tsx): Refactor code for better readability and maintainability 🔥 remove(ClipElementLocal.tsx, ClipElementRemote.tsx, ClipList.tsx): Remove unused imports and props ✨ feat(App.tsx, SignIn.tsx, SignUp.tsx, ClipElementLocal.tsx, ClipElementRemote.tsx, ClipList.tsx, ClipView.tsx, ClipViewLocal.tsx, ClipViewRemote.tsx, Auth.tsx, Clips.tsx, Intro.tsx, Settings.tsx, themes.ts, utils.ts): Add new features such as theme support, responsive design, and utility functions
64 lines
2.2 KiB
TypeScript
64 lines
2.2 KiB
TypeScript
import 'react-native-gesture-handler';
|
|
// ^ le bouge pas ca casse tout ^
|
|
import { useState } from "react";
|
|
import { NavigationContainer, DefaultTheme } from '@react-navigation/native';
|
|
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
import { Provider } from 'react-redux';
|
|
import { store } from './src/redux/store';
|
|
import { MD3DarkTheme, MD3LightTheme, PaperProvider, Portal } from 'react-native-paper';
|
|
import { ToastProvider } from 'react-native-toast-notifications'
|
|
import AuthPage from './src/pages/Auth';
|
|
import ClipPage from './src/pages/Clips';
|
|
import IntroPage from './src/pages/Intro';
|
|
import { StatusBar } from 'expo-status-bar';
|
|
import { Material3Dracula, ReactNavigationDracula } from './src/themes';
|
|
import { PixelRatio, useWindowDimensions } from 'react-native';
|
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
const Stack = createNativeStackNavigator();
|
|
|
|
|
|
|
|
function App(){
|
|
const [token,setToken] = useState("");
|
|
const [username,setUsername] = useState("");
|
|
|
|
const {height,width} = useWindowDimensions();
|
|
console.log(width);
|
|
console.log(PixelRatio.get())
|
|
|
|
store.subscribe(()=>{
|
|
let newToken = store.getState().user.token;
|
|
setToken(newToken);
|
|
})
|
|
|
|
return (
|
|
<PaperProvider theme={Material3Dracula}>
|
|
<ToastProvider>
|
|
<Provider store={store}>
|
|
<StatusBar style="light"/>
|
|
<SafeAreaProvider>
|
|
<NavigationContainer theme={ReactNavigationDracula}>
|
|
<Stack.Navigator>
|
|
{
|
|
token !== "" ? (
|
|
<>
|
|
<Stack.Screen name="Home" component={ClipPage} options={{ headerShown: false }}/>
|
|
</>
|
|
) : (
|
|
<>
|
|
<Stack.Screen name="Intro" component={IntroPage} options={{ headerShown: false }} />
|
|
<Stack.Screen name="SignIn" component={AuthPage} options={{ headerShown: false }} />
|
|
</>
|
|
)
|
|
}
|
|
</Stack.Navigator>
|
|
</NavigationContainer>
|
|
</SafeAreaProvider>
|
|
</Provider>
|
|
</ToastProvider>
|
|
</PaperProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|