diff --git a/src/App.tsx b/src/App.tsx index e3cc1d1..afcc81c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,6 @@ import React, { useRef } from 'react'; -import { Route, Switch, useLocation } from 'react-router-dom'; +import { Route, Switch, useLocation, Redirect } from 'react-router-dom'; import styles from '@src/App.module.scss'; -import LandingPage from '@src/pages/LandingPage'; import LoginPage from '@src/pages/LoginPage'; import JoinPage from '@src/pages/JoinPage'; import IdeaPage from '@src/pages/IdeaPage'; @@ -16,6 +15,8 @@ import SideReadPage from '@src/pages/SideReadPage'; import AlertModal from '@src/components/modals/AlertModal'; import { useAppDispatch, useUiState, hideGlobalAlert } from '@src/store'; +const PATH_CHECK = ['login', 'join', 'idea', 'side', 'mypage']; + const App = () => { const { isGlobalAlertVisible, globalAlertMessage } = useUiState(); const dispatch = useAppDispatch(); @@ -38,7 +39,6 @@ const App = () => {
- { redirectPath="/login" render={(props) => } /> + {pathname && !PATH_CHECK.some((each) => pathname.includes(each)) && ( + + )}
{isGlobalAlertVisible && ( - + { + e.stopPropagation(); + onClose(); + }} + />
{ const { @@ -13,7 +15,7 @@ const AlarmCardContainer = (props: Alarm) => { showModal: showIdea, hideModal: hideIdea, } = useModalControl(); - + const dispatch = useAppDispatch(); const history = useHistory(); const deleteAlarmMutation = useDeleteAlarm(); @@ -33,7 +35,24 @@ const AlarmCardContainer = (props: Alarm) => {
deleteAlarmMutation.mutate(props.id)} + onClose={() => + deleteAlarmMutation.mutate(props.id, { + onSuccess: () => { + dispatch( + showGlobalAlert({ + globalAlertMessage: '댓글 알림을 삭제하였습니다.', + }), + ); + }, + onError: () => { + dispatch( + showGlobalAlert({ + globalAlertMessage: GuideText.ERROR, + }), + ); + }, + }) + } {...props} /> {isIdeaVisible && props.id && ( diff --git a/src/pages/LandingPage/LandingPage.module.scss b/src/pages/LandingPage/LandingPage.module.scss deleted file mode 100644 index b141f5a..0000000 --- a/src/pages/LandingPage/LandingPage.module.scss +++ /dev/null @@ -1,6 +0,0 @@ -.LandingPage { - @include flex_col(); - - width: 100%; - height: 100%; -} diff --git a/src/pages/LandingPage/index.tsx b/src/pages/LandingPage/index.tsx deleted file mode 100644 index 184b186..0000000 --- a/src/pages/LandingPage/index.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React from 'react'; -import { setLoading, useAppDispatch, useUiState } from '@src/store'; -import cn from 'classnames'; -import { CardWithContent } from '@src/components/common/Card/Card.stories'; -import { LabelTags } from '@src/components/common/LabelTag/LabelTag.stories'; - -import styles from '@src/pages/LandingPage/LandingPage.module.scss'; -import SideCard from '@src/components/SideCard'; - -const HIGHLIGHT = 'highlight'; - -const LandingPage = () => { - const dispatch = useAppDispatch(); - const { isLoading } = useUiState(); - - return ( -
- - - -
- {isLoading ?

loading

:

break

} -
- - -
- ); -}; - -export default LandingPage; diff --git a/src/pages/SidePage/index.tsx b/src/pages/SidePage/index.tsx index a11252b..78c6daa 100644 --- a/src/pages/SidePage/index.tsx +++ b/src/pages/SidePage/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo, useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import cn from 'classnames'; import styles from './SidePage.module.scss'; @@ -23,18 +23,12 @@ import Typography from '@src/components/common/Typography'; import { setSide, useAppDispatch, useSideState } from '@src/store'; import Input, { ParentRef } from '@src/components/common/Input'; import { useAuth } from '@src/hooks/useUserQuery'; -import { useLocation } from 'react-router-dom'; -import { GuideText } from '@src/constant/enums'; interface SidePageProps { handleToTop?: () => void; } const SidePage = ({ handleToTop }: SidePageProps) => { - const location = useLocation(); - - const status = useMemo(() => location.state as string, [location]); - // 첫 화면 렌더링시 애니메이션 실행 안되도록 처리함 const [init, setInit] = useState(false); const [isFilterOpen, setIsFilterOpen] = useState(false);