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

Result refactor/#137 #140

Merged
merged 14 commits into from
Sep 7, 2024
4 changes: 2 additions & 2 deletions app/(sub-page)/sign-in/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export default function SignInPage() {
</div>
<SignInForm />
<div className="flex mt-12 space-x-4 h-6 items-center justify-center">
<Link href={'/'}>
<Link href={'/find-id'}>
<Button className="text-xs" label="์•„์ด๋”” ์ฐพ๊ธฐ" variant={'text'} />
</Link>
<Separator orientation={'vertical'} />
<Link href={'/'}>
<Link href={'/find-password'}>
<Button className="text-xs" label="๋น„๋ฐ€๋ฒˆํ˜ธ ์žฌ์„ค์ •" variant={'text'} />
</Link>
<Separator orientation={'vertical'} />
Expand Down
Binary file removed app/favicon.ico
Binary file not shown.
76 changes: 32 additions & 44 deletions app/mocks/data.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const resultCategoryDetailInfo = JSON.parse(`{
"completed": false
}
],
"completed": false
"completed": false
}`);

export const users = JSON.parse(`[
Expand All @@ -206,75 +206,63 @@ export const users = JSON.parse(`[

export const credits = JSON.parse(`[
{
"category": "COMMON_CULTURE",
"totalCredit" : 70,
"takenCredit" : 40,
"completed": false
},
{
"category": "CORE_CULTURE",
"totalCredit" : 70,
"takenCredit" : 40,
"completed": false
},
{
"category": "PRIMARY_MANDATORY_MAJOR",
"totalCredit" : 70,
"takenCredit" : 40,
"completed": false
"category": "DUAL_BASIC_ACADEMICAL_CULTURE",
"totalCredit": 6,
"takenCredit": 6.0,
"completed": true
},
{
"category": "PRIMARY_ELECTIVE_MAJOR",
"totalCredit" : 70,
"takenCredit" : 40,
"totalCredit": 24,
"takenCredit": 21.0,
"completed": false
},
{
"category": "DUAL_MANDATORY_MAJOR",
"totalCredit" : 70,
"takenCredit" : 40,
"totalCredit": 21,
"takenCredit": 18.0,
"completed": false
},
{
"category": "DUAL_ELECTIVE_MAJOR",
"totalCredit" : 70,
"takenCredit" : 40,
"completed": false
"category": "CORE_CULTURE",
"totalCredit": 12,
"takenCredit": 12.0,
"completed": true
},
{
"category": "SUB_MAJOR",
"totalCredit" : 70,
"takenCredit" : 40,
"category": "PRIMARY_BASIC_ACADEMICAL_CULTURE",
"totalCredit": 18,
"takenCredit": 15.0,
"completed": false
},
{
"category": "PRIMARY_BASIC_ACADEMICAL_CULTURE",
"totalCredit" : 70,
"takenCredit" : 40,
"category": "COMMON_CULTURE",
"totalCredit": 17,
"takenCredit": 16.5,
"completed": false
},
{
"category": "DUAL_BASIC_ACADEMICAL_CULTURE",
"totalCredit" : 70,
"takenCredit" : 40,
"completed": false
"category": "PRIMARY_MANDATORY_MAJOR",
"totalCredit": 18,
"takenCredit": 18.0,
"completed": true
},
{
"category": "NORMAL_CULTURE",
"totalCredit" : 70,
"takenCredit" : 40,
"category": "DUAL_ELECTIVE_MAJOR",
"totalCredit": 24,
"takenCredit": 0.0,
"completed": false
},
{
"category": "FREE_ELECTIVE",
"totalCredit" : 70,
"takenCredit" : 40,
"category": "CHAPEL",
"totalCredit": 2,
"takenCredit": 1.5,
"completed": false
},
{
"category": "CHAPEL",
"totalCredit" : 4,
"takenCredit" : 1,
"category": "SUB_MAJOR",
"totalCredit" : 70,
"takenCredit" : 40,
"completed": false
}
]`);
Expand Down
11 changes: 6 additions & 5 deletions app/ui/result/result-category-card/result-category-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ function ResultCategoryCard({ category, totalCredit, takenCredit }: ResultCatego
setIsOpenDialog(true);
};

const getCategoryCredit = (category: ResultCategoryKey, credit: number): number => {
return category === RESULT_CATEGORY.CHAPEL ? credit * 2 : credit;
};
const getCategoryCredit = (category: ResultCategoryKey, credit: number) =>
category === RESULT_CATEGORY.CHAPEL ? credit * 2 : credit;

const getCategoryCountWay = (category: ResultCategoryKey) => (category === RESULT_CATEGORY.CHAPEL ? 'ํšŸ์ˆ˜' : 'ํ•™์ ');

const filterCategoryExistStandard = (category: ResultCategoryKey) => {
const NONEXIST_STANDARD_CATEGORY = ['FREE_ELECTIVE', 'NORMAL_CULTURE', 'CHAPEL'];
Expand All @@ -96,11 +97,11 @@ function ResultCategoryCard({ category, totalCredit, takenCredit }: ResultCatego
<div className={cn('w-full flex text-xs font-medium justify-between items-end', 'md:gap-4 md:text-base')}>
<div>
<div className="flex gap-2">
<span>๊ธฐ์ค€ํ•™์ </span>
<span>๊ธฐ์ค€{getCategoryCountWay(category)}</span>
<span className="font-bold">{getCategoryCredit(category, totalCredit)}</span>
</div>
<div className="flex gap-2">
<span>์ด์ˆ˜ํ•™์ </span>
<span>์ด์ˆ˜{getCategoryCountWay(category)}</span>
<span className={cn('font-bold', percentage === 100 ? 'text-point-blue' : 'text-etc-red')}>
{getCategoryCredit(category, takenCredit)}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ export default function ResultCategoryDetailContentSkeleton() {
</div>
<Skeleton className="h-10 w-28" />
</div>
{Array.from({ length: 3 }).map((_, index) => (
<div className="my-4 flex flex-col gap-4" key={index}>
<LabelContainerSkeleton rightElement={<Skeleton className="h-10 w-28" />} />
<Skeleton className="h-40 w-30" />
</div>
))}
<div className="my-4 flex flex-col gap-4">
<LabelContainerSkeleton rightElement={<Skeleton className="h-10 w-28" />} />
<Skeleton className="h-40 w-30" />
</div>
</div>
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image ๊ธฐ์ค€ํ•™์ ๋ณด๋‹ค ์ด์ˆ˜ํ•™์ ์ด ๋” ๋งŽ์„ ๋•Œ ํŒŒ๋ž€์ƒ‰์œผ๋กœ ์ˆซ์ž๋ฅผ ํ‘œ๊ธฐํ•˜๋Š” ๊ฒŒ ๋” ๋‚ซ์ง€์•Š์„๊นŒ์š”?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useState } from 'react';
import { ResultCategoryDetailLectureToggle } from '../result-category-detail-lecture/result-category-detail-lecture-toggle';
import ResultCagegoryDetailLecture from '../result-category-detail-lecture/result-cagegory-detail-lecture';
import { ResultCategoryDetailResponse } from '@/app/store/querys/result';
import { RESULT_CATEGORY_KO, ResultCategoryKey } from '@/app/utils/key/result-category.key';
import { RESULT_CATEGORY, RESULT_CATEGORY_KO, ResultCategoryKey } from '@/app/utils/key/result-category.key';

interface ResultCategoryDetailContentProps extends ResultCategoryDetailResponse {
category: ResultCategoryKey;
Expand All @@ -19,12 +19,14 @@ function ResultCategoryDetailContent({
}: ResultCategoryDetailContentProps) {
const [isTakenLecture, setIsTakenLectrue] = useState(false);

const includeChaple = (category: ResultCategoryKey) => category === RESULT_CATEGORY.COMMON_CULTURE;

return (
<div className="md:w-[80vw] max-w-[1200px] p-2 overflow-scroll">
<div className={cn('flex justify-between mb-6', 'md:mb-10')}>
<div>
<h1 className={cn('text-2xl font-bold', 'md:text-4xl')}>{RESULT_CATEGORY_KO[category]}</h1>
<div className={cn('relative flex items-center gap-2 text-sm text-gray-6 font-medium my-2', 'md:text-lg')}>
<div className={cn('relative flex items-center gap-2 text-sm text-gray-6 font-medium my-2', 'md:text-lg')}>
<span className="hidden md:block"> {RESULT_CATEGORY_KO[category]} ๊ณผ๋ชฉ ์ค‘</span>
<div className="w-20 h-10">
<ResultCategoryDetailLectureToggle
Expand All @@ -37,11 +39,15 @@ function ResultCategoryDetailContent({
</div>
<span>๊ณผ๋ชฉ์ด ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค.</span>
</div>
<div className={includeChaple(category) ? 'font-light text-gray-5 text-xs my-2 md:text-sm' : 'hidden'}>
* ์ฑ„ํ”Œ์ด ํฌํ•จ๋œ ํ•™์ ์œผ๋กœ, ์ฑ„ํ”Œ๊ณผ๋ชฉ์˜ ์ด์ˆ˜์œจ์€ ์ฑ„ํ”Œ ์นดํ…Œ๊ณ ๋ฆฌ์—์„œ ํ™•์ธ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
</div>
</div>
<div className={cn('text-2xl font-bold', 'md:text-4xl')}>
<div className={cn('min-w-fit text-2xl font-bold', 'md:text-4xl')}>
<span className="text-point-blue">{takenCredit}</span> / {totalCredit}
</div>
</div>

{detailCategory.map((categoryInfo, index) => (
<ResultCagegoryDetailLecture isTakenLecture={isTakenLecture} detailCategory={categoryInfo} key={index} />
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import AnnounceMessageBox from '@/app/ui/view/molecule/announce-message-box/anno
import LabelContainer from '@/app/ui/view/atom/label-container/label-container';
import { cn } from '@/app/utils/shadcn/utils';
import { ResultCategoryDetailLecturesResponse } from '@/app/store/querys/result';
import CompletedImage from '@/public/assets/completed-category.png';

const headerInfo = ['๊ณผ๋ชฉ์ฝ”๋“œ', '๊ณผ๋ชฉ๋ช…', 'ํ•™์ '];

Expand All @@ -15,6 +16,7 @@ function ResultCagegoryDetailLecture({ detailCategory, isTakenLecture }: ResultC
const { categoryName, totalCredit, takenCredit, takenLectures, haveToLectures, completed } = detailCategory;

const showCompleted = !isTakenLecture && completed;
const showNoneLecture = isTakenLecture && takenLectures.length === 0;

return (
<div className={cn('my-4 flex flex-col gap-4 min-h-48', 'md:min-h-60')}>
Expand All @@ -27,9 +29,12 @@ function ResultCagegoryDetailLecture({ detailCategory, isTakenLecture }: ResultC
}
/>
{showCompleted ? (
<AnnounceMessageBox message="ํ•ด๋‹น ํŒŒํŠธ์˜ ์กธ์—…์š”๊ฑด์„ ์ถฉ์กฑํ•˜์…จ์Šต๋‹ˆ๋‹ค!" />
<AnnounceMessageBox message="ํ•ด๋‹น ํŒŒํŠธ์˜ ์กธ์—…์š”๊ฑด์„ ์ถฉ์กฑํ•˜์…จ์Šต๋‹ˆ๋‹ค!" background_image={CompletedImage} />
) : (
<Table headerInfo={headerInfo} data={isTakenLecture ? takenLectures : haveToLectures} />
<>
<Table headerInfo={headerInfo} data={isTakenLecture ? takenLectures : haveToLectures} />
{showNoneLecture && <AnnounceMessageBox message="์ด์ˆ˜ํ•œ ๊ณผ๋ชฉ ์ •๋ณด๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค." />}
</>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image ์ด์ˆ˜ํ•œ ๊ณผ๋ชฉ์ด ์—†์„ ๋•Œ ๋‚˜ํƒ€๋‚˜๋Š” ์„ ์„ ์ง€์›Œ์•ผํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋˜ํ•œ ์ด์ˆ˜ํ•œ ๊ณผ๋ชฉ์ด ์—†๋Š” ๊ฑด๋ฐ, ์ฒดํฌ ์ด๋ชจ์ง€๊ฐ€ ์ ์ ˆํ•˜์ง€ ์•Š์€ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!

UI๊ฐ€ ์ผ๊ด€๋˜๋Š” ๊ฒŒ ๋” ๋‚˜์„ ๊ฒƒ ๊ฐ™์•„ ํ…Œ์ด๋ธ” ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ œ๊ฑฐ ํ•  ํ•„์š”๋Š” ์—†์–ด๋ณด์ž…๋‹ˆ๋‹ค

Copy link
Member Author

@yougyung yougyung Sep 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List component์—์„œ props๋กœ ๋ฐ›๊ณ  ์žˆ๋Š”emptyDataRender๋ฅผ Table ์ปดํฌ๋„ŒํŠธ์—์„œ๋„ props๋กœ ๋ฐ›์•„ ์ „๋‹ฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ณ€๊ฒฝํ•˜์˜€์Šต๋‹ˆ๋‹ค. List ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ž˜ ๋งŒ๋“ค์–ด์ฃผ์…”์„œ, Table ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ†ตํ•ด์„œ data๊ฐ€ ๋นˆ๊ฒฝ์šฐ๋ฅผ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๊ฒŒ๋˜์–ด ์ฝ”๋“œ๊ฐ€ ํ›จ์”ฌ ๊น”๋”ํ•˜๊ฒŒ ์ž‘์„ฑ๋  ์ˆ˜ ์žˆ์—ˆ๋˜ ๊ฒƒ ๊ฐ™์•„์š”. 86f417d
แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2024-09-06 แ„‹แ…ฉแ„’แ…ฎ 3 24 04

)}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion app/ui/user/find-password-from/find-password-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function FindPasswordForm({ authId }: FindPasswordFormProps) {
};

return (
<Form id="๋น„๋ฐ€๋ฒˆํ˜ธ ์žฌ์„ค์ •" action={resetPassword} onSuccess={onSuccess}>
<Form id="๋น„๋ฐ€๋ฒˆํ˜ธ ์žฌ์„ค์ •" action={resetPassword} onSuccess={onSuccess} className="flex flex-col gap-4">
<Form.PasswordInput
required={true}
label="๋น„๋ฐ€๋ฒˆํ˜ธ"
Expand Down
16 changes: 7 additions & 9 deletions app/ui/user/find-password-from/find-password-validate-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ interface FindPasswordValidateFormProps {
}
function FindPasswordValidateForm({ onNext }: FindPasswordValidateFormProps) {
return (
<div>
<Form id="๊ฐ€์ž…์ž ๊ฒ€์ฆ" onSuccess={onNext} action={validateUser}>
<Form.TextInput required={true} label="์•„์ด๋””" id="authId" placeholder="์•„์ด๋””๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”." />
<Form.TextInput required={true} label="ํ•™๋ฒˆ" id="studentNumber" placeholder="ex ) 60xxxxxx" />
<div className="py-6">
<Form.SubmitButton label="๊ฒ€์‚ฌํ•˜๊ธฐ" position="center" variant="primary" />
</div>
</Form>
</div>
<Form id="๊ฐ€์ž…์ž ๊ฒ€์ฆ" onSuccess={onNext} action={validateUser} className="flex flex-col gap-4">
<Form.TextInput required={true} label="์•„์ด๋””" id="authId" placeholder="์•„์ด๋””๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”." />
<Form.TextInput required={true} label="ํ•™๋ฒˆ" id="studentNumber" placeholder="ex ) 60xxxxxx" />
<div className="py-6">
<Form.SubmitButton label="๊ฒ€์‚ฌํ•˜๊ธฐ" position="center" variant="primary" />
</div>
</Form>
);
}

Expand Down
13 changes: 0 additions & 13 deletions app/ui/user/user-info-card/init-user-announce.tsx

This file was deleted.

8 changes: 2 additions & 6 deletions app/ui/user/user-info-card/user-info-card.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import { InitUserInfoResponse, UserInfoResponse } from '@/app/business/services/user/user.type';
import InitUserAnnounce from './init-user-announce';
import UserInfoContent from './user-info-content';
import { fetchUser } from '@/app/business/services/user/user.query';
import { isInitUser } from '@/app/business/services/user/user.validation';

async function UserInfoCard() {
const data = await fetchUser();

function isInitUser(x: UserInfoResponse | InitUserInfoResponse): x is InitUserInfoResponse {
return typeof x.studentName === null;
}

function renderUserInfo(data: UserInfoResponse | InitUserInfoResponse) {
return isInitUser(data) ? <InitUserAnnounce /> : <UserInfoContent data={data} />;
return isInitUser(data) ? <></> : <UserInfoContent data={data} />;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ถ„๊ธฐ์ฒ˜๋ฆฌ๋ฅผ ํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์•„๋‹ˆ๋ฏ€๋กœ ์ €๋„ ๋‹จ์–ธ์ด ๋” ์ ์ ˆํ•˜๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋„์›€์ด ํ•„์š”ํ•œ ๋ถ€๋ถ„ ์ž˜ ์ฝ์–ด๋ดค์Šต๋‹ˆ๋‹ค. ์ œ ์ƒ๊ฐ์—๋Š” ํƒ€์ž… ๋‹จ์–ธ๋ณด๋‹ค ๊ธฐ์กด ์ฝ”๋“œ๊ฐ€ ๋” ์ ์ ˆํ•ฉ๋‹ˆ๋‹ค. ์ด์œ ๋Š” ํƒ€์ž… ๋‹จ์–ธ์„ ์‚ฌ์šฉํ•˜๋ฉด ๋…ผ๋ฆฌ์  ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธฐ๊ณ  ์˜ˆ๊ธฐ์น˜ ์•Š์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

user-info-card๋Š” user ๋„๋ฉ”์ธ์— ์œ„์น˜ํ•œ ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ์ด๋ฏ€๋กœ, ์ด ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์–ด๋Š ํŽ˜์ด์ง€์—์„œ ์‚ฌ์šฉ๋˜๋Š”์ง€๋Š” ๊ด€์‹ฌ์‚ฌ๋ฅผ ๋ฒ—์–ด๋‚ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ ๋…ผ์˜์—์„œ๋Š” ์ด ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๊ฒฐ๊ณผ ํŽ˜์ด์ง€์—์„œ๋งŒ ์‚ฌ์šฉ๋œ๋‹ค๊ณ  ๊ฐ€์ •ํ•˜๊ณ  initUser๋ฅผ ๊ณ ๋ คํ•˜์ง€ ์•Š์•„๋„ ๋œ๋‹ค๊ณ  ์ƒ๊ฐํ•˜์ง€๋งŒ, ์‹ค์ œ๋กœ๋Š” ์–ด๋Š ํŽ˜์ด์ง€์—์„œ ์ด ์ปดํฌ๋„ŒํŠธ๊ฐ€ ์žฌ์‚ฌ์šฉ๋ ์ง€ ๋ชจ๋ฅด๊ธฐ ๋•Œ๋ฌธ์— ํƒ€์ž… ๋‹จ์–ธ์„ ์‚ฌ์šฉํ•˜๋ฉด ์žฌ์‚ฌ์šฉ์„ฑ์ด ๋–จ์–ด์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ฌผ๋ก  ํƒ€์ž… ๋‹จ์–ธ์„ ํ•ด๋„ ๋‹น์žฅ์€ ๋ฌธ์ œ๊ฐ€ ์ƒ๊ธฐ์ง€ ์•Š๊ฒ ์ง€๋งŒ, ์ด ์ปดํฌ๋„ŒํŠธ๋Š” result ํŽ˜์ด์ง€์™€ ๊ฐ™์ด ์œ ์ €๊ฐ€ ์ด๋ฏธ ์ดˆ๊ธฐํ™”๋œ ๊ณณ์—์„œ๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์˜คํžˆ๋ ค ์ด๋ ‡๊ฒŒ ๋˜๋ฉด ์ฝ”๋“œ๋ฅผ ์ดํ•ดํ•˜๊ธฐ ๋” ์–ด๋ ต๊ฒŒ ๋งŒ๋“ค๊ณ  ์žฌ์‚ฌ์šฉ์„ฑ์„ ๋–จ์–ดํŠธ๋ฆฐ๋‹ค ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ƒˆ๋กœ์šด ๋™๋ฃŒ ๊ฐœ๋ฐœ์ž๊ฐ€ ์ƒˆ ํŽ˜์ด์ง€๋ฅผ ๊ฐœ๋ฐœํ•˜๋ฉด์„œ ์ด ์ปดํฌ๋„ŒํŠธ๋ฅผ ์žฌ์‚ฌ์šฉํ•˜๋ ค ํ•  ๋•Œ, ์ดˆ๊ธฐํ™”๋˜์ง€ ์•Š์€ ์œ ์ €๋กœ ์ธํ•ด ์˜ˆ์ƒ์น˜ ๋ชปํ•œ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์€ ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฒซ์งธ, ๊ธฐ์กด๋Œ€๋กœ ์ดˆ๊ธฐํ™”๋˜์ง€ ์•Š์€ ์œ ์ €๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ๋กœ์ง์„ ๋งŒ๋“œ๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๋‘˜์งธ, ๋งŒ์•ฝ ์ด ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๊ฒฐ๊ณผ ํŽ˜์ด์ง€ ์™ธ์—๋Š” ์‚ฌ์šฉ๋˜์ง€ ์•Š์„ ๊ฒƒ์ด ํ™•์‹คํ•˜๊ธฐ์— ์žฌ์‚ฌ์šฉ์„ฑ์„ ๊ณ ๋ คํ•˜๊ณ  ์‹ถ์ง€ ์•Š๋‹ค๋ฉด, ์•„ํ‚คํ…์ฒ˜์ƒ ์œ„์น˜๋ฅผ ๋ณ€๊ฒฝํ•˜์—ฌ ๊ฒฐ๊ณผ ํŽ˜์ด์ง€ ์ „์šฉ ์ปดํฌ๋„ŒํŠธ์ž„์„ ๋ช…ํ™•ํžˆ ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

๋ฒˆ์™ธ๋กœ ์ €๋Š” ๊ธฐ์กด InitUserAnnounce ์ปดํฌ๋„ŒํŠธ์ฒ˜๋Ÿผ (์•„๋‹ˆ๋ฉด ์ปดํฌ๋„ŒํŠธ ๋ช…์„ ์ฐจ๋ผ๋ฆฌ NoData์™€ ๊ฐ™์ด ๋ฌธ์ œ๊ฐ€ ์žˆ์Œ์„ ๋‚˜ํƒ€๋‚ด๋Š” ๋ฐฉ์‹์œผ๋กœ ํ‘œํ˜„ํ•ด๋„ ๋ฉ๋‹ˆ๋‹ค) "์„ฑ์ ํ‘œ PDF๋ฅผ ์—…๋กœ๋“œํ•ด์•ผ ์กธ์—…์‚ฌ์ • ๊ฒฐ๊ณผ๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ์–ด์š”."๋ผ๊ณ  ์•Œ๋ ค์ฃผ๋Š” ๊ฒŒ ๋™๋ฃŒ ๊ฐœ๋ฐœ์ž๊ฐ€ ์ฝ”๋“œ๋ฅผ ์ฝ์„ ๋•Œ๋„ ๋” ์ดํ•ด๊ฐ€ ์ž˜ ๋  ๊ฑฐ๋ผ๊ณ  ์ƒ๊ฐ์ด ๋“œ๋„ค์š”.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user-info-card๊ฐ€ ๋„๋ฉ”์ธ ์ปดํฌ๋„ŒํŠธ๋ผ๋Š” ๊ฐ€์ •์„ ๋†“์น˜๊ณ  ์žˆ์—ˆ๋„ค์š”. ์˜๊ฒฌ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! bbb0101

}

return <>{renderUserInfo(data)}</>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import React from 'react';
import CompletedImage from '@/public/assets/completed-category.png';
import CheckImage from '@/public/assets/check.svg';
import Image from 'next/image';
import { cn } from '@/app/utils/shadcn/utils';
import { StaticImport } from 'next/dist/shared/lib/get-img-props';

interface AnnounceMessageBoxProp {
message: string;
background_image?: string | StaticImport;
}

function AnnounceMessageBox({ message }: AnnounceMessageBoxProp) {
function AnnounceMessageBox({ message, background_image }: AnnounceMessageBoxProp) {
return (
<div className="relative flex justify-center items-center p-2 bg-yellow-5">
<Image
src={CompletedImage}
width={1200}
height={270}
alt="category-fullfill-image"
className={cn('min-h-20 max-h-40', 'md:min-h-32')}
/>
<div className="relative flex justify-center items-center p-2 bg-gray-1 min-h-24 rounded-3xl">
{background_image && (
<Image
src={background_image}
width={1200}
height={270}
alt="announcebox_background_image"
className={cn('min-h-20 max-h-40', 'md:min-h-32')}
/>
)}
<div className="absolute">
<Image
className={cn('m-auto w-[30px]', 'md:w-[50px]')}
Expand Down
7 changes: 3 additions & 4 deletions app/ui/view/molecule/pie-chart/pie-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ export interface PieChartProp {
}

function PieChart({ percentage }: PieChartProp) {
const filterdPercentage = percentage > 100 ? 100 : percentage;

const isDesktop = useMediaQuery('(min-width: 767px)');

return (
<div
className={cn(
'piechart relative aspect-square rounded-full w-[6.5rem] h-[6.5rem]',
'relative aspect-square rounded-full w-[6.5rem] h-[6.5rem]',
percentage > 0 && 'piechart',
percentage === 100 ? 'bg-light-blue-1 complete' : 'bg-etc-pink',
'md:w-[9rem] md:h-[9rem]',
)}
Expand All @@ -33,7 +32,7 @@ function PieChart({ percentage }: PieChartProp) {
'md:w-[6rem] md:h-[6rem] md:text-xl ',
)}
>
{filterdPercentage}%
{percentage}%
</div>
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion app/utils/chart.util.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const getPercentage = (numerator: number, denominator: number) => {
return Number(((numerator / denominator) * 100).toFixed(0));
const percentage = Number(((numerator / denominator) * 100).toFixed(0));
return percentage > 100 ? 100 : percentage;
};
2 changes: 1 addition & 1 deletion app/utils/key/result-category.key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const RESULT_CATEGORY = {
} as const;

export const RESULT_CATEGORY_KO = {
COMMON_CULTURE: '์ผ๋ฐ˜๊ต์–‘',
COMMON_CULTURE: '๊ณตํ†ต๊ต์–‘',
CORE_CULTURE: 'ํ•ต์‹ฌ๊ต์–‘',
PRIMARY_MANDATORY_MAJOR: '์ „๊ณตํ•„์ˆ˜',
PRIMARY_ELECTIVE_MAJOR: '์ „๊ณต์„ ํƒ',
Expand Down
Loading