mirror of
https://github.com/anultravioletaurora/Jellify.git
synced 2026-02-15 03:10:23 -06:00
106 lines
2.4 KiB
TypeScript
106 lines
2.4 KiB
TypeScript
import './gesture-handler';
|
|
import React, { useState } from 'react';
|
|
import type {PropsWithChildren} from 'react';
|
|
import {
|
|
SafeAreaView,
|
|
StatusBar,
|
|
StyleSheet,
|
|
Text,
|
|
useColorScheme,
|
|
View,
|
|
} from 'react-native';
|
|
|
|
import {
|
|
Colors,
|
|
} from 'react-native/Libraries/NewAppScreen';
|
|
import { NavigationContainer } from '@react-navigation/native';
|
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
import { usePlayer } from './player/queries';
|
|
import Login from './components/Login/component';
|
|
import Player from './components/Player/component';
|
|
import Jellify from './components/Jellify/component';
|
|
|
|
type SectionProps = PropsWithChildren<{
|
|
title: string;
|
|
}>;
|
|
|
|
function Section({children, title}: SectionProps): React.JSX.Element {
|
|
const [isDarkMode, setIsDarkMode ] = useState(useColorScheme() === 'dark');
|
|
|
|
return (
|
|
<View style={styles.sectionContainer}>
|
|
<Text
|
|
style={[
|
|
styles.sectionTitle,
|
|
{
|
|
color: isDarkMode ? Colors.white : Colors.black,
|
|
},
|
|
]}>
|
|
{title}
|
|
</Text>
|
|
<Text
|
|
style={[
|
|
styles.sectionDescription,
|
|
{
|
|
color: isDarkMode ? Colors.light : Colors.dark,
|
|
},
|
|
]}>
|
|
{children}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function App(): React.JSX.Element {
|
|
const isDarkMode = useColorScheme() === 'dark';
|
|
|
|
usePlayer;
|
|
|
|
const backgroundStyle = {
|
|
backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,
|
|
};
|
|
|
|
|
|
const RootStack = createStackNavigator();
|
|
|
|
return (
|
|
<NavigationContainer>
|
|
<SafeAreaView style={backgroundStyle}>
|
|
<StatusBar
|
|
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
|
|
backgroundColor={backgroundStyle.backgroundColor}
|
|
/>
|
|
<RootStack.Navigator>
|
|
<RootStack.Group>
|
|
<RootStack.Screen name="Jellify" component={Jellify} />
|
|
</RootStack.Group>
|
|
<RootStack.Group screenOptions={{ presentation: 'modal' }}>
|
|
<RootStack.Screen name="Player" component={Player} />
|
|
</RootStack.Group>
|
|
</RootStack.Navigator>
|
|
</SafeAreaView>
|
|
</NavigationContainer>
|
|
);
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
sectionContainer: {
|
|
marginTop: 32,
|
|
paddingHorizontal: 24,
|
|
},
|
|
sectionTitle: {
|
|
fontSize: 24,
|
|
fontWeight: '600',
|
|
},
|
|
sectionDescription: {
|
|
marginTop: 8,
|
|
fontSize: 18,
|
|
fontWeight: '400',
|
|
},
|
|
highlight: {
|
|
fontWeight: '700',
|
|
},
|
|
});
|
|
|
|
export default App;
|