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] 데이터가 없을 때에 대한 핸들링 (최근 쓴 코멘트, 인연 스코어) #334

Merged
merged 4 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion app/src/Profile/dashboard-contents/Eval/DestinyRanking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
DashboardContentNotFound,
} from '@shared/components/DashboardContentView/Error';
import { UserRankList } from '@shared/components/DashboardContentView/Rank/UserRankList';
import { TextDefault } from '@shared/components/DashboardContentView/Text/TextDefault';
import { useContext } from 'react';

const GET_DESTINY_RANKING_BY_LOGIN = gql(/* GraphQL */ `
Expand Down Expand Up @@ -54,7 +55,11 @@ export const DestinyRanking = () => {

return (
<DashboardContent title={title} description={description}>
<UserRankList list={destinyRanking} cnt={5} unit={unit} />
{destinyRanking.length !== 0 ? (
<UserRankList list={destinyRanking} cnt={5} unit={unit} />
) : (
<TextDefault text="인연 기록이 없어요" />
)}
</DashboardContent>
);
};
26 changes: 19 additions & 7 deletions app/src/Profile/dashboard-contents/Eval/RecentComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
DashboardContentLoading,
DashboardContentNotFound,
} from '@shared/components/DashboardContentView/Error';
import { TextDefault } from '@shared/components/DashboardContentView/Text/TextDefault';
import { InfoTooltip } from '@shared/components/InfoTooltip';
import { Text } from '@shared/ui-kit';
import { useContext } from 'react';
Expand Down Expand Up @@ -35,12 +36,23 @@ export const RecentComment = () => {
const { recentComment } = data.getPersonalEval; // FIXME: null일 수 있음.

return (
<DashboardContent
title={title}
titleRight={<InfoTooltip text="코멘트 : 평가하러 가서 작성한 리뷰" />}
type="Scrollable"
>
<Text>{recentComment}</Text>
</DashboardContent>
<>
{recentComment ? (
<DashboardContent
title={title}
titleRight={<InfoTooltip text="코멘트 : 평가하러 가서 작성한 리뷰" />}
type="Scrollable"
>
<Text>{recentComment}</Text>
</DashboardContent>
) : (
<DashboardContent
title={title}
titleRight={<InfoTooltip text="코멘트 : 평가하러 가서 작성한 리뷰" />}
>
<TextDefault text="평가 기록이 없어요" />
</DashboardContent>
)}
</>
);
};
36 changes: 24 additions & 12 deletions app/src/Profile/dashboard-contents/General/TeamInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { UserProfileContext } from '@/Profile/contexts/UserProfileContext';
import { useQuery } from '@apollo/client';
import styled from '@emotion/styled';
import { gql } from '@shared/__generated__';
import { DashboardContent } from '@shared/components/DashboardContent';
import {
DashboardContentBadRequest,
DashboardContentLoading,
DashboardContentNotFound,
} from '@shared/components/DashboardContentView/Error';
import { TextDefault } from '@shared/components/DashboardContentView/Text/TextDefault';
import { useContext } from 'react';
import { TeamInfoTable } from './TeamInfoTable';

Expand Down Expand Up @@ -41,19 +43,29 @@ export const TeamInfo = () => {

const { teams } = data.getPersonalGeneral.teamInfo;

const title = '팀 정보';

return (
<TeamInfoLayout>
<div
style={{
position: 'relative',
width: '100%',
height: '100%',
overflow: 'auto',
}}
>
<TeamInfoTable teams={teams} />
</div>
</TeamInfoLayout>
<>
{teams.length === 0 ? (
<TeamInfoLayout>
<div
style={{
position: 'relative',
width: '100%',
height: '100%',
overflow: 'auto',
}}
>
<TeamInfoTable teams={teams} />
</div>
</TeamInfoLayout>
) : (
<DashboardContent title={title}>
<TextDefault text="프로젝트 신청 기록이 없어요" />
</DashboardContent>
)}
</>
);
};

Expand Down
2 changes: 1 addition & 1 deletion app/src/Project/dashboard-contents/ValidatedRate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const ValidatedRate = () => {
if (validatedRate.total === 0) {
return (
<DashboardContent title={title}>
<H3Text>제출 기록이 없어요 😐</H3Text>
<H3Text>제출 기록이 없어요</H3Text>
</DashboardContent>
);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/Team/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const TeamPage = () => {
<VStack w="100%" align="start" spacing="3rem">
<H2BoldText>평가 기록</H2BoldText>
{moulinette == null && evalLogs.length === 0 ? (
<Text>평가 기록이 없습니다.</Text>
<Text>평가 기록이 없어요</Text>
) : null}
<VStack w="100%" align="start" spacing="1.5rem">
<EvalLogList list={evalLogs} />
Expand Down