-
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 refactor/#137 #140
Result refactor/#137 #140
Conversation
๐storybook: https://65ccb85d5afe55a024495bc0-immuppvxss.chromatic.com/ |
๐storybook: https://65ccb85d5afe55a024495bc0-gnlglwvjpb.chromatic.com/ |
๐storybook: https://65ccb85d5afe55a024495bc0-epkdymtqci.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.
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.
2024-09-06.12.38.24.mov
์ผ๋ฐ ๊ต์์ด ๋ ๋ฒ ๋ณด์ ๋๋ค ํ์ธ ๋ถํ๋๋ฆฝ๋๋ค !
function renderUserInfo(data: UserInfoResponse | InitUserInfoResponse) { | ||
return isInitUser(data) ? <InitUserAnnounce /> : <UserInfoContent data={data} />; | ||
return isInitUser(data) ? <></> : <UserInfoContent data={data} />; |
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.
๋ถ๊ธฐ์ฒ๋ฆฌ๋ฅผ ํ๋ ์ปดํฌ๋ํธ๊ฐ ์๋๋ฏ๋ก ์ ๋ ๋จ์ธ์ด ๋ ์ ์ ํ๋ค๊ณ ์๊ฐํฉ๋๋ค
{showNoneLecture && <AnnounceMessageBox message="์ด์ํ ๊ณผ๋ชฉ ์ ๋ณด๊ฐ ์กด์ฌํ์ง ์์ต๋๋ค." />} | ||
</> |
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.
List component์์ props๋ก ๋ฐ๊ณ ์๋emptyDataRender
๋ฅผ Table ์ปดํฌ๋ํธ์์๋ props
๋ก ๋ฐ์ ์ ๋ฌํ ์ ์๊ฒ ๋ณ๊ฒฝํ์์ต๋๋ค. List ์ปดํฌ๋ํธ๋ฅผ ์ ๋ง๋ค์ด์ฃผ์
์, Table ์ปดํฌ๋ํธ๋ฅผ ํตํด์ data๊ฐ ๋น๊ฒฝ์ฐ๋ฅผ ์ฒ๋ฆฌํ ์ ์๊ฒ๋์ด ์ฝ๋๊ฐ ํจ์ฌ ๊น๋ํ๊ฒ ์์ฑ๋ ์ ์์๋ ๊ฒ ๊ฐ์์. 86f417d
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.
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.
2024-09-06.12.38.24.mov
์ผ๋ฐ ๊ต์์ด ๋ ๋ฒ ๋ณด์ ๋๋ค ํ์ธ ๋ถํ๋๋ฆฝ๋๋ค !
์ ๋ง์ ๋ง ๊ฐ์ฌํฉ๋๋ค .......! e3915c2 |
๐storybook: https://65ccb85d5afe55a024495bc0-shkzhlexbg.chromatic.com/ |
๐storybook: https://65ccb85d5afe55a024495bc0-fkknhzzeny.chromatic.com/ |
function renderUserInfo(data: UserInfoResponse | InitUserInfoResponse) { | ||
return isInitUser(data) ? <InitUserAnnounce /> : <UserInfoContent data={data} />; | ||
return isInitUser(data) ? <></> : <UserInfoContent data={data} />; |
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 ๋๋ฉ์ธ์ ์์นํ ๋๋ฉ์ธ ์ปดํฌ๋ํธ์ด๋ฏ๋ก, ์ด ์ปดํฌ๋ํธ๊ฐ ์ด๋ ํ์ด์ง์์ ์ฌ์ฉ๋๋์ง๋ ๊ด์ฌ์ฌ๋ฅผ ๋ฒ์ด๋ฉ๋๋ค. ํ์ฌ ๋ ผ์์์๋ ์ด ์ปดํฌ๋ํธ๊ฐ ๊ฒฐ๊ณผ ํ์ด์ง์์๋ง ์ฌ์ฉ๋๋ค๊ณ ๊ฐ์ ํ๊ณ initUser๋ฅผ ๊ณ ๋ คํ์ง ์์๋ ๋๋ค๊ณ ์๊ฐํ์ง๋ง, ์ค์ ๋ก๋ ์ด๋ ํ์ด์ง์์ ์ด ์ปดํฌ๋ํธ๊ฐ ์ฌ์ฌ์ฉ๋ ์ง ๋ชจ๋ฅด๊ธฐ ๋๋ฌธ์ ํ์ ๋จ์ธ์ ์ฌ์ฉํ๋ฉด ์ฌ์ฌ์ฉ์ฑ์ด ๋จ์ด์ง ์ ์์ต๋๋ค.
๋ฌผ๋ก ํ์ ๋จ์ธ์ ํด๋ ๋น์ฅ์ ๋ฌธ์ ๊ฐ ์๊ธฐ์ง ์๊ฒ ์ง๋ง, ์ด ์ปดํฌ๋ํธ๋ result ํ์ด์ง์ ๊ฐ์ด ์ ์ ๊ฐ ์ด๋ฏธ ์ด๊ธฐํ๋ ๊ณณ์์๋ง ์ฌ์ฉํ ์ ์๊ฒ ๋ฉ๋๋ค. ์คํ๋ ค ์ด๋ ๊ฒ ๋๋ฉด ์ฝ๋๋ฅผ ์ดํดํ๊ธฐ ๋ ์ด๋ ต๊ฒ ๋ง๋ค๊ณ ์ฌ์ฌ์ฉ์ฑ์ ๋จ์ดํธ๋ฆฐ๋ค ์๊ฐํฉ๋๋ค. ์๋ฅผ ๋ค์ด, ์๋ก์ด ๋๋ฃ ๊ฐ๋ฐ์๊ฐ ์ ํ์ด์ง๋ฅผ ๊ฐ๋ฐํ๋ฉด์ ์ด ์ปดํฌ๋ํธ๋ฅผ ์ฌ์ฌ์ฉํ๋ ค ํ ๋, ์ด๊ธฐํ๋์ง ์์ ์ ์ ๋ก ์ธํด ์์์น ๋ชปํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ ์ ์์ต๋๋ค.
ํด๊ฒฐ ๋ฐฉ๋ฒ์ ๋ ๊ฐ์ง๊ฐ ์์ต๋๋ค. ์ฒซ์งธ, ๊ธฐ์กด๋๋ก ์ด๊ธฐํ๋์ง ์์ ์ ์ ๋ฅผ ์ฒ๋ฆฌํ๋ ๋ก์ง์ ๋ง๋๋ ๊ฒ์ ๋๋ค. ๋์งธ, ๋ง์ฝ ์ด ์ปดํฌ๋ํธ๊ฐ ๊ฒฐ๊ณผ ํ์ด์ง ์ธ์๋ ์ฌ์ฉ๋์ง ์์ ๊ฒ์ด ํ์คํ๊ธฐ์ ์ฌ์ฌ์ฉ์ฑ์ ๊ณ ๋ คํ๊ณ ์ถ์ง ์๋ค๋ฉด, ์ํคํ ์ฒ์ ์์น๋ฅผ ๋ณ๊ฒฝํ์ฌ ๊ฒฐ๊ณผ ํ์ด์ง ์ ์ฉ ์ปดํฌ๋ํธ์์ ๋ช ํํ ํ๋ ๊ฒ์ ๋๋ค.
๋ฒ์ธ๋ก ์ ๋ ๊ธฐ์กด InitUserAnnounce ์ปดํฌ๋ํธ์ฒ๋ผ (์๋๋ฉด ์ปดํฌ๋ํธ ๋ช ์ ์ฐจ๋ผ๋ฆฌ NoData์ ๊ฐ์ด ๋ฌธ์ ๊ฐ ์์์ ๋ํ๋ด๋ ๋ฐฉ์์ผ๋ก ํํํด๋ ๋ฉ๋๋ค) "์ฑ์ ํ PDF๋ฅผ ์ ๋ก๋ํด์ผ ์กธ์ ์ฌ์ ๊ฒฐ๊ณผ๋ฅผ ํ์ธํ ์ ์์ด์."๋ผ๊ณ ์๋ ค์ฃผ๋ ๊ฒ ๋๋ฃ ๊ฐ๋ฐ์๊ฐ ์ฝ๋๋ฅผ ์ฝ์ ๋๋ ๋ ์ดํด๊ฐ ์ ๋ ๊ฑฐ๋ผ๊ณ ์๊ฐ์ด ๋๋ค์.
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๊ฐ ๋๋ฉ์ธ ์ปดํฌ๋ํธ๋ผ๋ ๊ฐ์ ์ ๋์น๊ณ ์์๋ค์. ์๊ฒฌ ๊ฐ์ฌํฉ๋๋ค! bbb0101
๐storybook: https://65ccb85d5afe55a024495bc0-flrhtkhlya.chromatic.com/ |
This reverts commit e511297.
๐storybook: https://65ccb85d5afe55a024495bc0-qzjigsxkjz.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.
์๊ณ ํ์ จ์ต๋๋ค
๐ ์์ ๋ด์ฉ
๊ฒฐ๊ณผํ์ด์ง ๋ฐ ๋ก๊ทธ์ธํ์ด์ง์ ์๋ ๊ฐ์ ์ฌํญ๋ค์ ์์ ํ์ต๋๋ค
2024-09-05.10.05.33.mov
๐ ๋์์ด ํ์ํ ๋ถ๋ถ
1.
UserInfoCard
์ ํ์ ๊ฐ๋UserInfoCard
์ ํ์ ๊ฐ๋๋ฅผ ๋ชฉ์ ์ผ๋ก ์์ฑํrenderUserInfo
ํจ์๋ฅผ ๋ณด๋ฉด, ์ฌ์ฉ์์ ์ฑ์ ํ ์ ๋ ฅ์ฌ๋ถ(user type)์ ๋ฐ๋ผ ๋ค๋ฅธ ์ปดํฌ๋ํธ๋ฅผ ๋ ธ์ถํ๋ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค.ํ์ง๋ง init user๋ ๊ฒฐ๊ณผํ์ด์ง์ ์ง์ ํ์ง ๋ชปํ๊ธฐ ๋๋ฌธ์
InitUserAnnounce
๋ ์ค์ ๋ก ๋ ธ์ถ๋ ์ ์๋ ํน์ง์ ๊ฐ๊ณ ์๊ณ , ๋ ธ์ถ๋ ์ ์๋InitUserAnnounce
์ปดํฌ๋ํธ๊ฐ ์กด์ฌํ๋ ๊ฒ์ด ์ถํ ํจ๊ปํ๊ฒ ๋ ๊ฐ๋ฐ์์ ์ ์ฅ์์ ํผ๋์ค๋ฌ์ธ ์ ์๊ฒ ๋ค๋ ์๊ฐ์ด ๋ค์ด ์ ๊ฑฐ๋ฅผ ์งํํ์ด์. ๋๋ถ์ด ๊ณ ๋ฏผ์ ์งํํ๋ฉด์ ํ์ ๋จ์ธ์ด ์คํ๋ ค ํด๋น ์ปดํฌ๋ํธ์ ์ ์ ํ์ง ์์๊น? ๋ผ๋ ์๊ฐ์ด ๋ค์์ต๋๋ค. ์๋ ๋๊ฐ์ง ์๊ฒฌ ๋๋ฌธ์ธ๋ฐ, ํ์๋ถ๋ค์ ์๊ฒฌ์ด ๊ถ๊ธํด์.2. ์ด์๊ณผ๋ชฉ ์๋ ๊ฒฝ์ฐ ์๋ด๋ฌธ๊ตฌ ์ ๊ณต
์ด์๊ณผ๋ชฉ ์๋ ๊ฒฝ์ฐ ์๋ด๋ฌธ๊ตฌ ์ ๊ณตํ๋ ๊ฒฝ์ฐ ์ผ๊ด๋ UI๋ฅผ ๋ ธ์ถํ๊ธฐ ์ํด์
Table
์ปดํฌ๋ํธ๋ฅผ ์ ๊ฑฐํ์ง ์์๋๋ฐ, ํ์๋ถ๋ค์ ์๊ฒฌ์ ํตํด ์กฐ์ ํด๋ณด๊ณ ์ถ์ด์!