Skip to content

Commit

Permalink
refactor: booking쪽도 로그인 요구하는 화면은 NeedLogin으로 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
potados99 committed Sep 28, 2021
1 parent 4298d0f commit ae9cb01
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/presentation/features/booking/BookingScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import History from './History';
import Complete from './Complete';
import {observer} from 'mobx-react';
import Onboarding from './Onboarding';
import NeedLogin from './NeedLogin';
import OptionsList from './OptionsList';
import useUserState from '../../hooks/useUserState';
import OptionsDetail from './OptionsDetail';
Expand All @@ -33,7 +33,7 @@ import {createStackNavigator} from '@react-navigation/stack';
import BookingInfoHeaderButton from './History/BookingInfoHeaderButton';

export type BookingNavigationParams = {
BookingOnboarding: undefined;
BookingNeedLogin: undefined;
BookingStudentLogin: undefined;
BookingGuestLogin: undefined;

Expand All @@ -52,11 +52,11 @@ function BookingScreen() {
* 로그인 유도하는 화면.
* 전체화면으로 보여줄거라서 헤더는 숨김.
*/
const onboarding = (
const needLogin = (
<Stack.Screen
key="booking_onboarding"
name="BookingOnboarding"
component={Onboarding}
name="BookingNeedLogin"
component={NeedLogin}
options={{headerShown: false}}
/>
);
Expand Down Expand Up @@ -145,7 +145,7 @@ function BookingScreen() {

return (
<Stack.Navigator headerMode="screen" screenOptions={StackHeaderPresets.commonStackHeaderOptions}>
{isLoggedIn ? [history, list, detail, complete] : [onboarding, studentLogin, guestLogin]}
{isLoggedIn ? [history, list, detail, complete] : [needLogin, studentLogin, guestLogin]}
</Stack.Navigator>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import {StyleSheet, Text, View} from 'react-native';
import {BookingNavigationParams} from '../BookingScreen';

type Props = {
navigation: StackNavigationProp<BookingNavigationParams, 'BookingOnboarding'>;
navigation: StackNavigationProp<BookingNavigationParams, 'BookingNeedLogin'>;
};

function Onboarding({navigation}: Props) {
function NeedLogin({navigation}: Props) {
const {isTryingRememberedLogin} = useUserState();

const goStudentLogin = () => navigation.navigate('BookingStudentLogin');
Expand Down Expand Up @@ -67,7 +67,7 @@ function Onboarding({navigation}: Props) {
return isTryingRememberedLogin ? loadingView : onboardingContents;
}

export default observer(Onboarding);
export default observer(NeedLogin);

const styles = StyleSheet.create({
container: {
Expand Down
8 changes: 4 additions & 4 deletions src/presentation/features/membership/MembershipScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function MembershipScreen() {

const Stack = createStackNavigator<MembershipNavigationParams>();

const needLoginScreen = (
const needLogin = (
<Stack.Screen
key="membership_need_login_screen"
name="MembershipNeedLogin"
Expand All @@ -47,7 +47,7 @@ function MembershipScreen() {
/>
);

const loginScreen = (
const studentLogin = (
<Stack.Screen
key="membership_student_login_screen"
name="MembershipStudentLogin"
Expand All @@ -56,7 +56,7 @@ function MembershipScreen() {
/>
);

const barcodeScreen = (
const barcode = (
<Stack.Screen
key="membership_barcode_screen"
name="MembershipBarcode"
Expand All @@ -70,7 +70,7 @@ function MembershipScreen() {

return (
<Stack.Navigator headerMode="screen" screenOptions={StackHeaderPresets.commonStackHeaderOptions}>
{isLoggedInAsStudent ? [barcodeScreen] : [needLoginScreen, loginScreen]}
{isLoggedInAsStudent ? [barcode] : [needLogin, studentLogin]}
</Stack.Navigator>
);
}
Expand Down

0 comments on commit ae9cb01

Please sign in to comment.