Skip to content

Commit

Permalink
Chore : 기존 TabBar, Stack 제거 (#622)
Browse files Browse the repository at this point in the history
* chore : Footer를 앱에서도 보여준다

* feat : podfile.lock 버전 관리

* chore : 로그인 시 Stack 교체하는 코드 제거
  • Loading branch information
guesung authored Feb 17, 2024
1 parent ec9d7bc commit 58e38b7
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 92 deletions.
16 changes: 8 additions & 8 deletions packages/app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,11 @@ PODS:
- React-Core
- react-native-restart (0.0.27):
- React-Core
- react-native-safe-area-context (4.9.0):
- react-native-safe-area-context (4.8.2):
- React-Core
- react-native-splash-screen (3.3.0):
- React-Core
- react-native-webview (13.7.1):
- react-native-webview (13.6.4):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- React-NativeModulesApple (0.72.10):
Expand Down Expand Up @@ -639,7 +639,7 @@ PODS:
- FirebaseCoreExtension (= 10.20.0)
- React-Core
- RNFBApp
- RNGestureHandler (2.15.0):
- RNGestureHandler (2.14.1):
- RCT-Folly (= 2021.07.22.00)
- React-Core
- RNLocalize (3.0.6):
Expand All @@ -649,7 +649,7 @@ PODS:
- RNNotifee/NotifeeCore (= 7.8.2)
- RNNotifee/NotifeeCore (7.8.2):
- React-Core
- RNPermissions (4.1.1):
- RNPermissions (4.1.0):
- React-Core
- RNReanimated (3.6.2):
- RCT-Folly (= 2021.07.22.00)
Expand Down Expand Up @@ -957,9 +957,9 @@ SPEC CHECKSUMS:
react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8
react-native-flipper: 9c1957af24b76493ba74f46d000a5c1d485e7731
react-native-restart: 7595693413fe3ca15893702f2c8306c62a708162
react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b
react-native-safe-area-context: 0ee144a6170530ccc37a0fd9388e28d06f516a89
react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457
react-native-webview: 83525c9ed4138faf5d5e4f8eb74bf050992935be
react-native-webview: 107961c73db53d66549c867a3b64eaa20d34c41f
React-NativeModulesApple: c3e696ff867e4bc212266cbdf7e862e48a0166fd
React-perflogger: 43287389ea08993c300897a46f95cfac04bb6c1a
React-RCTActionSheet: 923afe77f9bb89da7c1f98e2730bfc9dde0eed6d
Expand All @@ -983,10 +983,10 @@ SPEC CHECKSUMS:
RNFBAnalytics: 4d39fee0e5e27ef7a8e4399cde6763bf60d4bbdb
RNFBApp: 5810d39f89d38272f29d9908cb19ef641922c081
RNFBMessaging: 8863c0206cc1a5577678eac6c1ec2b2965bd8e52
RNGestureHandler: 7909c50383a18f0cb10ce1db7262b9a6da504c03
RNGestureHandler: fe2be3be5598dc74329b211c58c9f2d231461769
RNLocalize: 4222a3756cdbe2dc9a5bdf445765a4d2572107cb
RNNotifee: 8e2d3df3f0e9ce8f5d1fe4c967431138190b6175
RNPermissions: 4f8f975d253881987535a7a3af42a7f7afb9b4c8
RNPermissions: f4d24aed07b82e3ccb11b8f6ec24dad141310631
RNReanimated: ce6bef77caeee09d7f022532cee0c8d9bad09c9a
RNScreens: 3c5b9f4a9dcde752466854b6109b79c0e205dad3
RNSVG: ba3e7232f45e34b7b47e74472386cf4e1a676d0a
Expand Down
27 changes: 9 additions & 18 deletions packages/app/src/components/OnBoarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,17 @@ export default function OnBoarding() {
const preloading = async () => {
const isUserOnBoardSeen = await AsyncStorage.getItem('onBoarding');
const isUserLogin = await AsyncStorage.getItem('isUserLogin');
if (isUserOnBoardSeen) {
if (isUserLogin === 'true') navigation.replace('BottomTab');
else
navigation.replace('WebViewContainer', {
url: `${SOURCE_URL}/join?step=1`,
});
} else {
// navigation.replace('OnBoarding');
}
if (!isUserOnBoardSeen) return;
if (isUserLogin === 'true')
navigation.replace('WebViewContainer', {
url: `${SOURCE_URL}/grouping`,
});
else
navigation.replace('WebViewContainer', {
url: `${SOURCE_URL}/join?step=1`,
});
};

// useEffect(() => {
// const lang = RNLocalize.getLocales()[0].languageCode;
// setlang(lang);
// preloading();
// setTimeout(() => {
// SplashScreen.hide();
// }, 500);
// }, []);

useEffect(() => {
const locales = RNLocalize.getLocales();
const languageCode = locales && locales.length > 0 ? locales[0].languageCode : 'en';
Expand Down
16 changes: 0 additions & 16 deletions packages/app/src/components/WebViewContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,6 @@ export default function WebViewContainer() {
}
break;
}
case 'AUTH': {
const { type, token } = data;
switch (data) {
case 'LOG_IN':
await AsyncStorage.setItem('isUserLogin', 'true');
navigation.replace('BottomTab');
break;
case 'LOG_OUT':
await AsyncStorage.setItem('isUserLogin', 'false');
navigation.replace('WebViewContainer', {
url: `${SOURCE_URL}/join?step=1`,
});
break;
}
break;
}
}
};

Expand Down
4 changes: 1 addition & 3 deletions packages/web/src/app/[lng]/(main)/community/page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import dynamic from 'next/dynamic';

import CommunityHeader from './components/CommunityHeader';
import ContentSection from './components/ContentSection.client';
import CreateArticleButton from './components/CreateArticleButton';

import { Keys, getCommunityArticles } from '@/apis/community';
import { LocalSuspenseErrorBoundary } from '@/components/ErrorBoundary';
import { Footer } from '@/components/Footer';
import { HydrationProvider } from '@/components/Provider';
import { Spacing } from '@/components/Spacing';

const Footer = dynamic(() => import('@/components/Footer/Footer'), { ssr: false });
interface CommunityPageProps {
params: {
lng: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ManageDetail from './components/ManageDetail.client';
import ManageHeader from './components/ManageHeader.client';

import { Keys, getApplies } from '@/apis/groups';
import { LocalSuspenseErrorBoundary } from '@/components/ErrorBoundary';
import { HydrationProvider } from '@/components/Provider';
Expand Down
3 changes: 1 addition & 2 deletions packages/web/src/app/[lng]/(main)/grouping/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import GroupingHeader from './components/GroupingHeader';

import { Keys, getGroups } from '@/apis/groups';
import { LocalSuspenseErrorBoundary } from '@/components/ErrorBoundary';
import { Footer } from '@/components/Footer';
import { HydrationProvider } from '@/components/Provider';
import { Spacing } from '@/components/Spacing';

const Footer = dynamic(() => import('@/components/Footer/Footer'), { ssr: false });

interface GroupingPageProps {
params: {
lng: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ContentSection from './components/ContentSection.client';
import MeetingParticipateHeader from './components/MeetingParticipateHeader';

import {
Keys,
getMeetingHosting,
Expand All @@ -9,10 +10,9 @@ import {
getMeetingWaiting,
} from '@/apis/meeting';
import { LocalSuspenseErrorBoundary } from '@/components/ErrorBoundary';
import { Footer } from '@/components/Footer';
import { HydrationProvider } from '@/components/Provider';
import dynamic from 'next/dynamic';

const Footer = dynamic(() => import('@/components/Footer/Footer'), { ssr: false });
interface MeetingPageProps {
params: {
lng: string;
Expand Down
5 changes: 2 additions & 3 deletions packages/web/src/app/[lng]/(main)/meeting/scrap/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import ContentSection from './components/ContentSection.client';
import MeetingScrapHeader from './components/MeetingScrapHeader';

import { Keys, getMeetingScrap } from '@/apis/meeting';
import { LocalSuspenseErrorBoundary } from '@/components/ErrorBoundary';
import { Footer } from '@/components/Footer';
import { HydrationProvider } from '@/components/Provider';
import dynamic from 'next/dynamic';

const Footer = dynamic(() => import('@/components/Footer/Footer'), { ssr: false });

interface MeetingPageProps {
params: {
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/app/[lng]/(main)/profile/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ProfileDetail from './components/ProfileDetail.client';
import ProfileHeader from './components/ProfileHeader.client';

import { Keys, getProfile } from '@/apis/profile';
import { LocalSuspenseErrorBoundary } from '@/components/ErrorBoundary';
import { Footer } from '@/components/Footer';
import { HydrationProvider } from '@/components/Provider';
import dynamic from 'next/dynamic';

const Footer = dynamic(() => import('@/components/Footer/Footer'), { ssr: false });
interface ProfilePageProps {
params: {
lng: string;
Expand Down
3 changes: 1 addition & 2 deletions packages/web/src/app/[lng]/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import NoMeeting from './(main)/meeting/components/NoMeeting';
import dynamic from 'next/dynamic';

const Footer = dynamic(() => import('@/components/Footer/Footer'), { ssr: false });
import { Footer } from '@/components/Footer';

export default function NotFound() {
return (
Expand Down
59 changes: 26 additions & 33 deletions packages/web/src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { NavLink } from '../NavLink';
import type { PageType } from '@/types';

import cn from '@/utils/cn';
import { getIsAndroid } from '@/utils/getIsAndroid';
import { getIsIOS } from '@/utils/getIsIOS';

interface TabType {
id: string;
Expand Down Expand Up @@ -56,35 +54,30 @@ export default function Footer({ page, isSpacing = true, spacingColor }: FooterP
const { t } = useTranslation('common');
const isSelected = (tab: TabType) => tab.name === page;

const isIOS = getIsIOS();
const isAndroid = getIsAndroid();

if (isIOS || isAndroid) return null;
else
return (
<>
<footer className="max-w-450 rounded-t-24 shadow-navigation fixed inset-x-0 bottom-0 mx-auto flex touch-pan-x bg-white pb-8 pt-12">
{tabList.map((tab: TabType) => (
<ButtonAnimation
key={tab.id}
className={cn('text-caption flex w-full flex-col text-center', {
'text-sign-brand': isSelected(tab),
'text-sign-tertiary': !isSelected(tab),
})}
>
<NavLink isReplace href={tab.url} scroll={false}>
<Icon
id={`32-footer-${tab.name}${isSelected(tab) ? '_selected' : '_default'}`}
width={32}
height={32}
className="mx-auto"
/>
<p>{t(tab.name)}</p>
</NavLink>
</ButtonAnimation>
))}
</footer>
{isSpacing && <div className="h-70" style={{ backgroundColor: spacingColor }} />}
</>
);
return (
<>
<footer className="max-w-450 rounded-t-24 shadow-navigation fixed inset-x-0 bottom-0 mx-auto flex touch-pan-x bg-white pb-8 pt-12">
{tabList.map((tab: TabType) => (
<ButtonAnimation
key={tab.id}
className={cn('text-caption flex w-full flex-col text-center', {
'text-sign-brand': isSelected(tab),
'text-sign-tertiary': !isSelected(tab),
})}
>
<NavLink isReplace href={tab.url} scroll={false}>
<Icon
id={`32-footer-${tab.name}${isSelected(tab) ? '_selected' : '_default'}`}
width={32}
height={32}
className="mx-auto"
/>
<p>{t(tab.name)}</p>
</NavLink>
</ButtonAnimation>
))}
</footer>
{isSpacing && <div className="h-70" style={{ backgroundColor: spacingColor }} />}
</>
);
}
6 changes: 3 additions & 3 deletions packages/web/src/hooks/useAppRouter.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getIsApp } from '@/utils/getIsApp';
import sendMessageToReactNative from '@/utils/sendMessageToReactNative';
import { useRouter } from 'next/navigation';

import sendMessageToReactNative from '@/utils/sendMessageToReactNative';

const useAppRouter = () => {
const isApp = getIsApp();
const isApp = false;
const router = useRouter();

const push = (path: string, scroll?: boolean) => {
Expand Down

0 comments on commit 58e38b7

Please sign in to comment.