Skip to content

Commit

Permalink
mainpage
Browse files Browse the repository at this point in the history
Seeker, Setter MainPage 생성
  • Loading branch information
miikii41 committed Sep 24, 2024
1 parent 1a68e31 commit 252e9a3
Show file tree
Hide file tree
Showing 7 changed files with 16,466 additions and 9,624 deletions.
120 changes: 21 additions & 99 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,13 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
*/

import React from 'react';
import type {PropsWithChildren} from 'react';
import {
SafeAreaView,
ScrollView,
StatusBar,
StyleSheet,
Text,
useColorScheme,
View,
} from 'react-native';

import {
Colors,
DebugInstructions,
Header,
LearnMoreLinks,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

type SectionProps = PropsWithChildren<{
title: string;
}>;
import { SafeAreaView, StatusBar, StyleSheet, useColorScheme } from 'react-native';
import { NavigationContainer } from '@react-navigation/native'; // 네비게이션 컨테이너 import
import { createNativeStackNavigator } from '@react-navigation/native-stack'; // 네이티브 스택 네비게이터 import
import MainPage from './src/components/Home/Main/MainPage';
import SeekerMainPage from './src/components/Home/Main/SeekerMainPage'; // SeekerMainPage 컴포넌트 불러오기
import SetterMainPage from './src/components/Home/Main/SetterMainPage'; // SeekerMainPage 컴포넌트 불러오기
import { Colors } from 'react-native/Libraries/NewAppScreen';

function Section({children, title}: SectionProps): React.JSX.Element {
const isDarkMode = 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>
);
}
const Stack = createNativeStackNavigator();

function App(): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
Expand All @@ -63,55 +17,23 @@ function App(): React.JSX.Element {
};

return (
<SafeAreaView style={backgroundStyle}>
<StatusBar
barStyle={isDarkMode ? 'light-content' : 'dark-content'}
backgroundColor={backgroundStyle.backgroundColor}
/>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={backgroundStyle}>
<Header />
<View
style={{
backgroundColor: isDarkMode ? Colors.black : Colors.white,
}}>
<Section title="Step One">
Edit <Text style={styles.highlight}>App.tsx</Text> to change this
screen and then come back to see your edits.
</Section>
<Section title="See Your Changes">
<ReloadInstructions />
</Section>
<Section title="Debug">
<DebugInstructions />
</Section>
<Section title="Learn More">
Read the docs to discover what to do next:
</Section>
<LearnMoreLinks />
</View>
</ScrollView>
</SafeAreaView>
<NavigationContainer>
<SafeAreaView style={[styles.container, backgroundStyle]}>
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
<Stack.Navigator>
<Stack.Screen name="MainPage" component={MainPage} />
<Stack.Screen name="SeekerMainPage" component={SeekerMainPage} />
<Stack.Screen name="SetterMainPage" component={SetterMainPage} />
{/* 추가적인 스크린 설정 가능 */}
</Stack.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',
container: {
flex: 1,
},
});

Expand Down
Loading

0 comments on commit 252e9a3

Please sign in to comment.