-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: stack 과 bottom tab 이용하여 페이지 이동 구현 #1 #6 #7
Merged
+180
−13
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
- dev
- (#7)
- feature/addScroll
- (#7)
commit 3cbb030399318e8ce46e90cbe9565544a790af0c
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,15 @@ | ||
import { StatusBar } from 'expo-status-bar'; | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
import { QueryClientProvider, QueryClient } from 'react-query'; | ||
import { NavigationContainer } from '@react-navigation/native'; | ||
import Root from './src/Navigations/Root'; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
export default function App() { | ||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
{/* <Router> | ||
</Router> */} | ||
<NavigationContainer> | ||
<Root /> | ||
</NavigationContainer> | ||
</QueryClientProvider> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: '#fff', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
import Stacks from './Stacks'; | ||
import Tabs from './Tabs'; | ||
|
||
const Stack = createNativeStackNavigator(); | ||
|
||
const Root = () => { | ||
return ( | ||
<Stack.Navigator | ||
screenOptions={{ | ||
headerShown: false, | ||
}} | ||
> | ||
<Stack.Screen name="Stacks" component={Stacks} /> | ||
<Stack.Screen name="Tabs" component={Tabs} /> | ||
</Stack.Navigator> | ||
); | ||
}; | ||
|
||
export default Root; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
|
||
import { SignupPage, LoginPage, EditPage } from '../screen/Index'; | ||
|
||
const Stack = createNativeStackNavigator(); | ||
|
||
const Stacks = () => { | ||
return ( | ||
<Stack.Navigator initialRouteName="로그인"> | ||
<Stack.Screen name="회원가입" component={SignupPage} /> | ||
<Stack.Screen name="로그인" component={LoginPage} /> | ||
<Stack.Screen name="수정 페이지" component={EditPage} /> | ||
</Stack.Navigator> | ||
); | ||
}; | ||
|
||
export default Stacks; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; | ||
import { MyPage, MainPage } from '../screen/Index'; | ||
import { Entypo } from '@expo/vector-icons'; | ||
import { FontAwesome } from '@expo/vector-icons'; | ||
|
||
const Tab = createBottomTabNavigator(); | ||
|
||
const Tabs = () => { | ||
return ( | ||
<Tab.Navigator> | ||
<Tab.Screen | ||
options={{ | ||
headerTitleAlign: 'center', | ||
tabBarShowLabel: false, | ||
tabBarIcon: ({ focused }) => | ||
focused ? ( | ||
<Entypo name="home" size={25} color="black" /> | ||
) : ( | ||
<Entypo name="home" size={25} color="lightgrey" /> | ||
), | ||
}} | ||
name="메인 페이지" | ||
component={MainPage} | ||
/> | ||
|
||
<Tab.Screen | ||
options={{ | ||
headerTitleAlign: 'center', | ||
tabBarShowLabel: false, | ||
tabBarIcon: ({ focused }) => | ||
focused ? ( | ||
<FontAwesome name="list-ul" size={23} color="black" /> | ||
) : ( | ||
<FontAwesome name="list-ul" size={23} color="lightgrey" /> | ||
), | ||
}} | ||
name="마이 페이지" | ||
component={MyPage} | ||
/> | ||
</Tab.Navigator> | ||
); | ||
}; | ||
|
||
export default Tabs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { View, Text, TouchableOpacity } from 'react-native'; | ||
|
||
const EditPage = ({ navigation: { navigate } }) => { | ||
return ( | ||
<View> | ||
<TouchableOpacity | ||
onPress={() => navigate('Tabs', { screen: '마이 페이지' })} | ||
> | ||
<Text>마이 페이지로</Text> | ||
</TouchableOpacity> | ||
</View> | ||
); | ||
}; | ||
|
||
export default EditPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import SignupPage from './SignupPage'; | ||
import MyPage from './MyPage'; | ||
import MainPage from './MainPage'; | ||
import LoginPage from './LoginPage'; | ||
import EditPage from './EditPage'; | ||
|
||
export { SignupPage, MyPage, MainPage, LoginPage, EditPage }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { TouchableOpacity, View, Text } from 'react-native'; | ||
|
||
const LoginPage = ({ navigation: { navigate } }) => { | ||
return ( | ||
<View> | ||
<TouchableOpacity | ||
onPress={() => navigate('Tabs', { screen: '메인 페이지' })} | ||
> | ||
<Text>로그인</Text> | ||
</TouchableOpacity> | ||
<TouchableOpacity onPress={() => navigate('회원가입')}> | ||
<Text>회원가입</Text> | ||
</TouchableOpacity> | ||
</View> | ||
); | ||
}; | ||
|
||
export default LoginPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { View, Text, TouchableOpacity } from 'react-native'; | ||
|
||
const MainPage = ({ navigation: { navigate } }) => { | ||
return ( | ||
<View> | ||
<TouchableOpacity | ||
onPress={() => navigate('Stacks', { screen: '로그인' })} | ||
> | ||
<Text>로그아웃</Text> | ||
</TouchableOpacity> | ||
</View> | ||
); | ||
}; | ||
|
||
export default MainPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { View, Text, TouchableOpacity } from 'react-native'; | ||
|
||
const MyPage = ({ navigation: { navigate } }) => { | ||
return ( | ||
<View> | ||
<TouchableOpacity | ||
onPress={() => navigate('Stacks', { screen: '수정 페이지' })} | ||
> | ||
<Text>수정 페이지로</Text> | ||
</TouchableOpacity> | ||
|
||
<TouchableOpacity | ||
onPress={() => navigate('Stacks', { screen: '로그인' })} | ||
> | ||
<Text>로그아웃</Text> | ||
</TouchableOpacity> | ||
</View> | ||
Comment on lines
+4
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 삭제 부탁드립니다. |
||
); | ||
}; | ||
|
||
export default MyPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { View, Text, TouchableOpacity } from 'react-native'; | ||
|
||
const SignupPage = ({ navigation: { navigate } }) => { | ||
return ( | ||
<View> | ||
<TouchableOpacity | ||
onPress={() => navigate('Tabs', { screen: '메인 페이지' })} | ||
> | ||
<Text>회원가입</Text> | ||
</TouchableOpacity> | ||
<TouchableOpacity onPress={() => navigate('로그인')}> | ||
<Text>로그인 페이지로</Text> | ||
</TouchableOpacity> | ||
</View> | ||
); | ||
}; | ||
|
||
export default SignupPage; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그아웃 기능 제공하나요?