-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor/bottom sheet #173
Conversation
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.
๋ฐํ ์ํธ ๋ฆฌํฉ ๋ ๊ณ ์ํ์ด~ ๋ฐํ ์ํธ ์ฌ์ฉํ๋ UI ์ปดํฌ๋ํธ์์ ๋ฐํ ์ํธ ๊ด๋ จ ๋ก์ง์ด ํจ์๋ก ๋ฐ๋ก ๋ถ๋ฆฌ๋๋๊น ์ข์๊ฒ ๊ฐ๊ณ , ํจ์ ์ฝ๋๊ฐ ๋์ด๋๊ธด ํ์ง๋ง ์ญํ ๋ณ๋ก ๋ถ๋ฆฌ๋๊ณ JSX๊ฐ ๋ง์ด ์ค์ด์ ๋๋ ์ง๊ธ ํํ ์ข์๊ฒ ๊ฐ์!
{/* {sheetType === 'contract' && ( | ||
<SheetButton | ||
onClickNext={sheetProps!.onClickNext!} | ||
disabledNext={sheetProps!.disabledNext!} | ||
label={sheetProps!.label!} | ||
/> | ||
)} */} |
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.
ํ์์๋ ์ฃผ์์ ์ญ์ ๋ถํ๋๋ฆฝ๋๋ค~
} | ||
}; | ||
|
||
return <>{renderComponent()}</>; |
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.
์ด๋ฐ๊ฒฝ์ฐ ํจ์๋ก ์์ ๋ถ๋ฆฌํ๋๊ฒ ๋ณด๋ค if else ๋ฌธ ์ฌ์ฉํ๋๊ฒ ์ฝ๋๋ฅผ ์์์๋ถํฐ ์๋๋ก ๊ณ์ํด์ ์ฝ์ด๋ด๋ ค๊ฐ ์ ์์ด์ ๊ฐ๋ ์ฑ์ด ๋ ์ข์๊ฒ ๊ฐ์ต๋๋ค. ๋ค์๊ณผ ๊ฐ์ ๊ตฌ์กฐ๋ฅผ ์ถ์ฒ๋๋ฆฝ๋๋ค.
let content: React.ReactElement = <></>;
if (state) {
content = ...
}
return (
<>{content}</>
);
}; | ||
|
||
function GlobalBottomSheet() { | ||
const state = useAppSelector(selectBottomSheetState); |
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.
state, ํน์ boomSheetState์ ๊ฒฝ์ฐ ์ด๋ค ๊ฐ๋ค์ ๊ฐ์ง ์ ์๋ ๋ณ์์ธ์ง ๊ฐ์ด ์์กํ๋๋ค. ์ข๋ ๊ตฌ์ฒด์ ์ธ ๋ณ์๋ช ์ฌ์ฉํ์๋ฉด ์ข์๊ฒ ๊ฐ์ต๋๋ค.
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.
state ๊ฐ์ ๊ตฌ์กฐ๋ถํดํ ๋น์ผ๋ก ๋ฐ๋ก ๋ฐ์ง ์๊ณ ์๋์ค์์ ํฉ๋๋ค. ๊ทธ๊ฑฐ๋ก ๋ณด์๋ฉด ๋ฌด์จ ๊ฐ๋ค์ด ์๋์ง ์ธ์ง๋ ๊ฑฐ๋ผ ์๊ฐํด์ ๋จ์ํ state๋ก ์ง์๋๋ฐ, bottomSheetState๋ก ์ผ๋จ ๋ค์ด๋ฐ ๋ณ๊ฒฝํ์ผ์
openSheetBySequence(openSheet); | ||
}; | ||
|
||
// 4-a. '๋๊ธธ์ด ํฌ๊ธฐ๋์์ด์' ๋ฐํ ์ํธ ํ์ธ ๋ฒํผ |
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.
์ฃผ์ ์์ฃผ ์ ์ ํ๋ค์
| typeof COMMON_SHEET_CONTENTS.ApproveCheck | ||
| typeof COMMON_SHEET_CONTENTS.DeleteCheck | ||
| typeof COMMON_SHEET_CONTENTS.DongilFailed | ||
| typeof COMMON_SHEET_CONTENTS.GiveUpCheck | ||
| typeof COMMON_SHEET_CONTENTS.GiveUpExceeded | ||
| typeof COMMON_SHEET_CONTENTS.SelectProfile | ||
| typeof COMMON_SHEET_CONTENTS.SheetCompleted; |
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.
์ ๋ ์ฐธ๊ณ ํด์ ๋ชจ๋ฌ RTK๋ก migration ํ๊ฒ ์ต๋๋น
๐ PR Summary
commonSheet ๋ฐํ ์ํธ๋ฅผ ์ ์ญ์ผ๋ก ๊ด๋ฆฌํฉ๋๋ค.
๐ฒ Working Branch
refactor/bottomSheet
๐ฒ TODOs
Related Issues
#167