-
Notifications
You must be signed in to change notification settings - Fork 0
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 fetch/#92 #95
Result fetch/#92 #95
Conversation
The merge-base changed after approval.
๐storybook: https://65ccb85d5afe55a024495bc0-wjhbwutjhy.chromatic.com/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ณ ์ํ์ จ์ต๋๋ค
app/(sub-page)/result/page.tsx
Outdated
|
||
interface ResultPageProp { | ||
searchParams: { category: string }; | ||
} | ||
|
||
function ResultPage({ searchParams }: ResultPageProp) { | ||
async function ResultPage({ searchParams }: ResultPageProp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async ํค์๋๋ฅผ ๋ฃ์ ์ด์ ๋ฅผ ์ค๋ช ํด์ฃผ์ค ์ ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ธฐ์กด ๊ตฌ์กฐ์์๋ data fetching์ ํด๋น ์ปดํฌ๋ํธ์์ ์งํํ๋๋ฐ, ๊ตฌ์กฐ ๋ณ๊ฒฝ์ด ๋ฐ์ํ๋ฉด์ ์์ ์ ๋๋ฝํ ๋ถ๋ถ๊ฐ์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค. 02a1e0f
export async function fetchResultUserInfo(): Promise<ResultUserInfo> { | ||
try { | ||
const response = await fetch(API_PATH.resultUserInfo, { | ||
headers: { | ||
Authorization: `Bearer ${cookies().get('accessToken')?.value}`, | ||
}, | ||
}); | ||
|
||
const result = await response.json(); | ||
|
||
httpErrorHandler(response, result); | ||
return result; | ||
} catch (error) { | ||
throw error; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์๊ฐ์
๋ก์ง์ผ๋ก ์ธํด fetch Result userInfo๋ฅผ ๋ง๋์
จ๋ค๊ณ ํ์
จ๋๋ฐ, ํน์ ์ด๋ก ์ธํด ์ด๋ค ๋ฌธ์ ๊ฐ ์์๋์ง ์๋ ค์ฃผ์ค ์ ์๋์!?
์ ๋ getUserInfo๋ฅผ ์ฌ์ฌ์ฉํ์ด์์..!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํ์ฌ mock data์ ์ค์ backend์์ ์ ์กํด์ฃผ๋ ๏ฟฝtype์ด ์ผ์นํ์ง ์์(๋ค์ ๊ณต ๋ฑ์ ์ฌ์ ๋ก ๋ณ๊ฒฝ๋์์ต๋๋ค) UserInfo type์ ๋ณ๊ฒฝํด์ฃผ๋ ๊ณผ์ ์ด ํ์ํ์ต๋๋ค. englishlevel studentID ๋ฑ์ ์์ฑ์ ํ์๊ฐ์ ๊ณผ์ ์์ ์ฌ์ฉ๋๋ ์์ฑ์ด๋ผ๋ ์๊ฐ์ด ๋ค์ด์, type์ ์ ๊ฐ ์์๋ก ๋ณ๊ฒฝํ์ง ์๊ณ ์๋กญ๊ฒ ์์ฑํ์ต๋๋ค
@@ -54,7 +66,7 @@ function ResultCategoryCard({ category, totalCredit, takenCredit }: ResultCatego | |||
<Image src={Book} width={24} height={24} alt="category-img" /> | |||
<h3>{RESULT_CATEGORY_KO[category]}</h3> | |||
</div> | |||
{filterSeveralMajor(category)} | |||
{displaySeveralMajor(category)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filter๋ฅผ display๋ก ๋ณ๊ฒฝํด์ ๋ ๋ช ํํด์ง ๊ฒ ๊ฐ๋ค์!
<span className="font-bold">{takeCategoryCredit(category, totalCredit)}</span> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ด์ ํ์ ์ ๊ฐ์ ธ์ค๊ธฐ ์ํด takenCategoryCredit์ด๋ผ๋ ๋ค์ด๋ฐ์ ์ฌ์ฉํ์ ๊ฒ ๊ฐ์๋ฐ getCategoryCredit์ด๋ caculateCategoryCredit ์ ์ด๋ ์ ๊ฐ์?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ฐ๋ฐ์ ์งํํ ๋น์์๋ ์ฑํ category์ ๊ฒฝ์ฐ์๋ง *2๋ฅผ ํตํด ํ์ ์ ์ทจ๋ํ๋ฏ๋ก ์์ ์ ์๋ฏธ๋ฅผ get๋ณด๋ค ๊ฐํ๊ฒ ์ ๋ฌํ๊ธฐ ์ํด์ take๋ฅผ ์ฌ์ฉํ์๋๋ฐ, ๋ต๋ณ์ ์์ฑํ๋ฉด์ CategoryCredit์์ฒด๊ฐ category๋ณ credit์ ๋ํ ์๋ฏธ๋ฅผ ํฌํจํ๋ฏ๋ก get์ด ๋ ์ ์ ํ ์ ์๊ฒ ๋ค๋ ์๊ฐ์ด ๋๋ค์. ์๊ฒฌ ๊ฐ์ฌํฉ๋๋ค. e795740
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user-info-card, user-info-naviagtor ์๋ฏธ๊ฐ ๋ชจํธํ ์๋ ์์ง์๋? ๋ผ๋ ์๊ฐ์ด ๋๋ค์
์ด๋ค ์ด๋ฆ์ด ์ข์์ง ์ ๋ ๋ฑ ์์ด๋์ด๊ฐ ๋ ์ค๋ฅด์ง ์์ง๋ง ์๊ฐํด๋ณด๊ฒ ์ต๋๋ค!
@@ -4,7 +4,7 @@ import logo from '../../../../public/assets/logo.svg'; | |||
export default function NavigationBar() { | |||
return ( | |||
<div className="absolute p-4 border-b-[1px] w-full"> | |||
<Image className="md:h-10 h-7 w-[110px] md:w-[150px]" width={150} height={100} src={logo} alt="main-logo" /> | |||
{/* <Image className="md:h-10 h-7 w-[110px] md:w-[150px]" width={150} height={100} src={logo} alt="main-logo" /> */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
์ฃผ์์ฒ๋ฆฌํ์ ์ด์ ๊ฐ ์๋์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐storybook: https://65ccb85d5afe55a024495bc0-ncmuasgxea.chromatic.com/ |
๐storybook: https://65ccb85d5afe55a024495bc0-mbtkkypczk.chromatic.com/ |
๐storybook: https://65ccb85d5afe55a024495bc0-okbqsvqsff.chromatic.com/ |
major: string; | ||
} | ||
|
||
export interface ResultUserInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ์ด ๋ถ๋ถ ๊ฐํ์ด PR๊ณผ ์ค๋ณต๋๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ ๋ถ์ด ํตํฉ ๊ณํ์ด ์์๊น์?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ธฐ์กด์ Mock data๋ก ํ์ฉ๋๊ณ ์๋ user์ ์ค์ ์๋ต๋ฐ๋ data์ ์ฐจ์ด๋ก ์ธํด ๋ถ๋ฆฌ ๋ฐ ํตํฉํ๋ ์ฝ๋๋ก ๋ฆฌํฉํ ๋ง์ ์งํํ ์์ ์
๋๋ค.
๊ธฐ์กด์๋ ๋์ผ PR์ ์์
์ ์งํํ ๊ณํ์ด์์ผ๋ ๋ณด๋ค ์์ธํ ๊ฐ๋ฐ ๊ณผ์ ์ ๋ํ ๊ณต์ ๋ฅผ ์ํด ๋ณ๋์ PR๋ก ๋ถ๋ฆฌํด์ ์ฌ๋ฆฌ๋๋กํ๊ฒ ์ต๋๋ค!
๐storybook: https://65ccb85d5afe55a024495bc0-lgmahcyldb.chromatic.com/ |
๐storybook: https://65ccb85d5afe55a024495bc0-xolrkhtegy.chromatic.com/ |
๐storybook: https://65ccb85d5afe55a024495bc0-kvwxdeecvk.chromatic.com/ |
๐storybook: https://65ccb85d5afe55a024495bc0-kguphjmmkh.chromatic.com/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ์๊ณ ๋ง์์ด์
๐ ์์ ๋ด์ฉ
๐ ๋์์ด ํ์ํ ๋ถ๋ถ