Skip to content
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

[Fix] 지원 안했으면 결과 페이지 막기 #317

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/views/ResultPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import useDate from '@hooks/useDate';
import { ThemeContext } from '@store/themeContext';
import NoMore from 'views/ErrorPage/components/NoMore';
import BigLoading from 'views/loadings/BigLoding';
import useGetMyInfo from 'views/SignedInPage/hooks/useGetMyInfo';

import FinalResult from './components/FinalResult';
import ScreeningResult from './components/ScreeningResult';

const ResultPage = () => {
const { handleChangeMode } = useContext(ThemeContext);
const { myInfoData, myInfoIsLoading } = useGetMyInfo();
const { submit, applicationPass } = myInfoData?.data || {};

const { NoMoreRecruit, NoMoreScreeningResult, NoMoreFinalResult, isLoading, isMakers } = useDate();

Expand All @@ -21,14 +24,15 @@ const ResultPage = () => {
};
}, [handleChangeMode]);

if (isLoading) return <BigLoading />;
if (NoMoreRecruit || (NoMoreScreeningResult && NoMoreFinalResult))
if (isLoading || myInfoIsLoading) return <BigLoading />;
if (!submit || NoMoreRecruit || (NoMoreScreeningResult && NoMoreFinalResult))
return <NoMore isMakers={isMakers} content="합불 확인 기간이 아니에요" />;

return (
<>
{!NoMoreScreeningResult && <ScreeningResult />}
{!NoMoreFinalResult && <FinalResult />}
{!NoMoreFinalResult &&
(applicationPass ? <FinalResult /> : <NoMore isMakers={isMakers} content="합불 확인 기간이 아니에요" />)}
</>
);
};
Expand Down