From 3239580c2a61c443b6ecca099bd76688b3335f5d Mon Sep 17 00:00:00 2001 From: Aditya Pawar Date: Tue, 28 Nov 2023 19:06:22 -0800 Subject: [PATCH] Move settings to its own folder --- src/app/settings/_layout.tsx | 11 ++++ src/app/{settings.tsx => settings/index.tsx} | 67 +++----------------- src/app/settings/styles.tsx | 51 +++++++++++++++ 3 files changed, 71 insertions(+), 58 deletions(-) create mode 100644 src/app/settings/_layout.tsx rename src/app/{settings.tsx => settings/index.tsx} (81%) create mode 100644 src/app/settings/styles.tsx diff --git a/src/app/settings/_layout.tsx b/src/app/settings/_layout.tsx new file mode 100644 index 00000000..d021a461 --- /dev/null +++ b/src/app/settings/_layout.tsx @@ -0,0 +1,11 @@ +import { Stack } from 'expo-router'; + +function StackLayout() { + return ( + + + + ); +} + +export default StackLayout; diff --git a/src/app/settings.tsx b/src/app/settings/index.tsx similarity index 81% rename from src/app/settings.tsx rename to src/app/settings/index.tsx index 7ca053a3..aafde3b6 100644 --- a/src/app/settings.tsx +++ b/src/app/settings/index.tsx @@ -1,17 +1,18 @@ import DateTimePicker from '@react-native-community/datetimepicker'; import { Redirect, router, Link } from 'expo-router'; import { useEffect, useState } from 'react'; -import { Text, StyleSheet, View, Alert, Platform } from 'react-native'; +import { Text, View, Alert, Platform } from 'react-native'; import { Button } from 'react-native-elements'; import { SafeAreaView } from 'react-native-safe-area-context'; -import StyledButton from '../components/StyledButton/StyledButton'; -import UserStringInput from '../components/UserStringInput/UserStringInput'; -import globalStyles from '../styles/globalStyles'; -import color from '../styles/colors'; -import { useSession } from '../utils/AuthContext'; -import supabase from '../utils/supabase'; -import AccountDataDisplay from '../components/AccountDataDisplay/AccountDataDisplay'; +import StyledButton from '../../components/StyledButton/StyledButton'; +import UserStringInput from '../../components/UserStringInput/UserStringInput'; +import globalStyles from '../../styles/globalStyles'; +import color from '../../styles/colors'; +import { useSession } from '../../utils/AuthContext'; +import supabase from '../../utils/supabase'; +import styles from './styles'; +import AccountDataDisplay from '../../components/AccountDataDisplay/AccountDataDisplay'; function SettingsScreen() { const { session, signOut } = useSession(); @@ -206,54 +207,4 @@ function SettingsScreen() { ); } -const styles = StyleSheet.create({ - button: { - marginBottom: 32, - }, - main: { - flex: 1, - width: '100%', - paddingLeft: 12, - justifyContent: 'space-between', - }, - verticallySpaced: { - paddingTop: 4, - paddingBottom: 4, - alignSelf: 'stretch', - }, - subheading: { - fontFamily: 'Manrope', - fontSize: 18, - fontStyle: 'normal', - fontWeight: '700', - paddingBottom: 16, - }, - heading: { - paddingBottom: 24, - fontFamily: 'Manrope', - fontSize: 24, - fontStyle: 'normal', - fontWeight: '700', - }, - back: { - paddingTop: 30, - paddingBottom: 16, - color: '#797979', - fontSize: 12, - fontWeight: '400', - }, - data: { - flexDirection: 'row', - flexWrap: 'wrap', - alignItems: 'flex-start', - marginBottom: -10, - }, - label: { - fontSize: 12, - fontFamily: 'Manrope', - fontStyle: 'normal', - fontWeight: '400', - }, -}); - export default SettingsScreen; diff --git a/src/app/settings/styles.tsx b/src/app/settings/styles.tsx new file mode 100644 index 00000000..ce87f5f1 --- /dev/null +++ b/src/app/settings/styles.tsx @@ -0,0 +1,51 @@ +import { StyleSheet } from 'react-native'; + +export default StyleSheet.create({ + button: { + marginBottom: 32, + }, + main: { + flex: 1, + width: '100%', + paddingLeft: 12, + justifyContent: 'space-between', + }, + verticallySpaced: { + paddingTop: 4, + paddingBottom: 4, + alignSelf: 'stretch', + }, + subheading: { + fontFamily: 'Manrope', + fontSize: 18, + fontStyle: 'normal', + fontWeight: '700', + paddingBottom: 16, + }, + heading: { + paddingBottom: 24, + fontFamily: 'Manrope', + fontSize: 24, + fontStyle: 'normal', + fontWeight: '700', + }, + back: { + paddingTop: 30, + paddingBottom: 16, + color: '#797979', + fontSize: 12, + fontWeight: '400', + }, + data: { + flexDirection: 'row', + flexWrap: 'wrap', + alignItems: 'flex-start', + marginBottom: -10, + }, + label: { + fontSize: 12, + fontFamily: 'Manrope', + fontStyle: 'normal', + fontWeight: '400', + }, +});