-
Notifications
You must be signed in to change notification settings - Fork 1
[feat] add mypage layout and responsive CSS #26
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
Conversation
Implemented Modal component
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.
์๋.. ์๊ฐ๋ฝ ํน์ 20๊ฐ์ ๊ฐ์?
์์ฒญ ๋น ๋ฅด๊ฒ ๋จผ๊ฐ๋ฅผ ๋ง์ด ๋ง๋์
จ๋ค์.. ๋๋จ์ฐ... ๐
๋ชจ๋ฌ ์ ๋ ์ธ์์๊ฒ ๋ง๋ค์ด์ฃผ์ธ์....๐ฅน
๊ทผ๋ฐ ์ ๋๋ค์ ํ๊ธ๋ก ๋๋๊ฐ์....!?
| await axios.put('/auth/password', { | ||
| password: data.currentPassword, | ||
| newPassword: data.newPassword, | ||
| }); |
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.
๋ชฌ๊ฐ.. ์ ๋ apiํธ์ถํ๋ ๋ถ๋ถ์ ๋ณ๋๋ก ๋นผ์ ์ปดํฌ๋ํธ์์๋ ํจ์ ํธ์ถ๋งํด์ ์ฐ๋ ๋ฐฉํฅ์ผ๋ก ํ๊ณ ์๋๋ฐ
์ด๋ ์ ๊ฐ์~?
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.
@devmanta ์ ์ ์์ ํฌ์คํธ ์์ฒญ์ ํ๊ธ ๋๋ค์ ์๋๋๋ฐ์???
๋ณ๋๋ก ๋นผ๋ฉด ์ข์ฃ !!! ๊ท์ฐฎ์์ ์ํ์ต๋๋ค.. ๐ค
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.
@najitwo ๊ทธ๋ฐ์ด์ ๋ผ๋ฉด ๋นผ.์ฃผ.์ธ.์. ๐
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.
๋ฑ๋ก๋ง ๊ทธ๋ผ ํ๊ธ์ด์๋๋๊ฑด๊ฐ. . . . . .
| }); | ||
| reset(); | ||
| } catch (error) { | ||
| if (error instanceof 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.
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.
catch์ error ํ์ ์ด unkown์ด๋ผ ํ์ ์ขํ๊ธฐ๋ก ์ฌ์ฉํ ๊ฒ ์ ๋๋ค.!!
| if (error.message === ERROR_MESSAGES.CURRENT_PASSWORD_INCORRECT) { | ||
| openModal(<AlertModal>{error.message}</AlertModal>); | ||
| setError('currentPassword', { | ||
| type: 'manual', | ||
| message: error.message, | ||
| }); | ||
| } | ||
| if (error.message === ERROR_MESSAGES.SAME_AS_OLD_PASSWORD) { | ||
| openModal(<AlertModal>{error.message}</AlertModal>); | ||
| setError('newPassword', { | ||
| type: 'manual', | ||
| message: error.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.
๋ชฌ๊ฐ..if๋ฌธ์์ if๋ฌธ์ ์ง์ํ๋ ๋๋์ด์ฌ์
switch ๋ฌธ์ ์ฐ๋ฉด ๋ ๋ณด๊ธฐ ํธํ ๊ฒ๊ฐ์์!
์๋๋ฉด ์๋ฐ๋๋๋ ์ข์๊ฒ๊ฐ์์~!
| if (error.message === ERROR_MESSAGES.CURRENT_PASSWORD_INCORRECT) { | |
| openModal(<AlertModal>{error.message}</AlertModal>); | |
| setError('currentPassword', { | |
| type: 'manual', | |
| message: error.message, | |
| }); | |
| } | |
| if (error.message === ERROR_MESSAGES.SAME_AS_OLD_PASSWORD) { | |
| openModal(<AlertModal>{error.message}</AlertModal>); | |
| setError('newPassword', { | |
| type: 'manual', | |
| message: error.message, | |
| }); | |
| } | |
| const errorHandlingMap = { | |
| [ERROR_MESSAGES.CURRENT_PASSWORD_INCORRECT]: 'currentPassword', | |
| [ERROR_MESSAGES.SAME_AS_OLD_PASSWORD]: 'newPassword', | |
| }; | |
| const field = errorHandlingMap[error.message]; | |
| if (field) { | |
| openModal(<AlertModal>{error.message}</AlertModal>); | |
| setError(field, { | |
| type: 'manual', | |
| message: error.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.
์ ํ์ผ์ด ๋ชจ๋ฌ์ธ๊ฑฐ์ฃ ..!?
๊ณต์ฉ์ ์ผ๋์ ๋๊ณ ๋ง๋์
จ๋ค๊ณ ํ๊ฑฐ์ฌ์ ์ถ๊ฐ ์๊ฒฌ ๋๋ฆฝ๋๋ค..!
๋ชจ๋ฌ ๋ณด๋ฉด์ ์์ ํ์ดํ์ด๋ x๋ฒํผ ์๊ฑฐ๋ ์๊ฑฐ๋ ์ด๊ฒ๋ ๊ณ ๋ คํด์ฃผ์๋ฉด ์ข์๊ฒ๊ฐ์์
ํ์ธ ๋ฒํผ๋ถ๋ถ๋ ์์์๋ ์๊ณ , ์์์๋ ์๋๊ฑฐ์ฌ์ ๋ด์ฉ+ํ๋จ๋ฒํผ ๊น์ง๋ฅผ children์ผ๋ก ๋ฐ๊ณ ,
๋ชจ๋ฌ์์ ํ์ดํ์ด๋ x ๋ฒํผ ์ด๊ฑฐ๋ฅผ ๋ชจ๋ฌ์์ ์ปจํธ๋กคํ๋ฉด ์ข์๊ฒ๊ฐ์ต๋๋ค.
๋ค์ ๊ฒ์ ๋ฐฐ๊ฒฝ์ ์คํฌ๋กค ๋ง๋๊ฑด ๋์ด์์๊น์?
๊ทธ๋ฆฌ๊ณ ๊ฒ์๋ฐฐ๊ฒฝ ํด๋ฆญํ๋ฉด์ ๋ชจ๋ฌ์ด ๋ซํ๋๊ฒ๋์! (์ด๊ฑด ๋ซํ๊ฑด์ง ์๋ซํ๊ฑด์ง๋ ๋ชจ๋ฌ props๋ก ์ปจํธ๋กคํ๋ฉด ๋ ์ฌ์ฉ์ฑ ๋์๊ฒ๊ฐ์์)
๋ชจ๋ฌ ๋์ธ๋ ์ฝ๊ฐ ์ค๋ฅด๋ฅต ์ ๋๋งค์ด์
์ถ๊ฐํ๋ฉด ๋ ์์ด๋ณด์ผ๊ฒ๊ฐ์ต๋๋ค~
๋ ๋ง์ฝ์ ์ฌ์ ๊ฐ ๋๋ค๋ฉด
๋ชจ๋ฌ ๋ด์์๋ ํญ ๋๋ฅด๋ฉด ๋ชจ๋ฌ ๋ด์ฉ์์๋ง ํฌ์ปค์ค ๋๊ฒ๋ ํ๋๊ฒ๋ ์๋๋ผ๊ณ ์ focusTrap ์ด๋ผ๊ณ ํ๋๋ฐ ์ด๊ฒ๋ ๊ณ ๋ คํด๋ณด๋ฉด ์ข์๊ฒ๊ฐ์์
๊ทธ๋ฆฌ๊ณ ๋ชจ๋ฌ ๋์ฐ๋ฉด focus๊ฐ๋ฅํ ์น๊ตฌ์ค์ ์ฒซ๋ฒ์งธ ์์์ ํฌ์ปค์ค ๊ฐ๊ฒํ๋ฉด ๋ชจ๋ฐ์ผ ํ๋ฉด์์ ๋ชฌ๊ฐ ๊ทธ๋๋ง ์งค๋ฆฌ๋ํ์? ์ด๋ฐ๊ฒ ๋ํ๊ฒ ๊ฐ๋๋ผ๊ตฌ์
์ ๊ฐ ์ ๋ฒ ํ๋ก์ ํธ ๋ ๋ชจ๋ฌ์ ์ง์ฐฉ(?)ํด์ ์ ๊ฐ ๊ตฌํํ๋ ๋ด์ฉ์์ฃผ๋ก ๋ง์๋๋ ค๋ด
๋๋ค...ใ
ใ
ใ
ํน์ ๋ง์๋๋ฆฐ๊ฑฐ์ค์ ์ด๋ฏธ ๊ตฌํ๋์ด์๋๋ฐ ์ ๊ฐ ๋ชป ์์?๋ณธ๊ฒ๋ ์์๊ฒ๊ฐ์์
์๋ง๋ค์ด์ฃผ์๋ฉด... ์ ๋ najitwo-modal ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ฐ๊ณ ์ถ๋ค์...๐ค๐ค
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.
ํค๋, ๋ฉ์ธ, ํธํฐ ์์ญ ์ด๋ฐ๊ฑด ์ง์ง ๋ชจ๋ฌ ๋ง๋ค ๋ค๋ฌ๋ผ์
๊ป๋ฐ๊ธฐ๋ง ๋ง๋ค๊ณ ํค๋, ๋ฉ์ธ, ํธํฐ๋ฅผ ์์ ์ปค์คํ
(children)์ผ๋ก ๋ค ๋ฐ๋๊ฑด ์ด๋ป๊ฒ ์๊ฐํ์๋์?
์คํฌ๋กค ๋ง๋๊ฒ,์ ๋๋ฉ์ด์
,ํฌ์ปค์ค ์ธ์งํ๊ณ ์์ต๋๋ค.!
๊ฒ์๋ฐฐ๊ฒฝ ํด๋ฆญํ๋ฉด์ ๋ชจ๋ฌ์ด ๋ซํ๋ค << ์ด๊ฒ๋ ๊ณ ๋ คํด๋ดค๋๋ฐ ๋์๋ณด๋ ์ถ๊ฐํ๋ค๊ฐ ์๋ชปํด๋ฆญํ๋ฉด ํ๋งํ ๊ฒ ๊ฐ์ต๋๋ค..๐
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.
๊ทธ๋ผ ๋ซ์์ง๋ง์ง๋ ํ๋กญ์ค๋ก ๋ฐ์์ ์ฒ๋ฆฌํ๋๊ฑด์!?
ํค๋,๋ฉ์ธ,ํธํฐ ๋ค ์์์ผ๋ก ๋ฐ์๋๋ ๊ฒ..๊ฐ์๋ฐ
ํค๋์ ๋๋ ๋ชจ๋ฌ์์ ํ๋๊ฑด์ด๋์ !?
(ํค๋๋ ์๊ฑฐ๋ ์๊ฑฐ๋ ๋ง๊ณ ์คํ์ผ์ ๋ค๋ฅธ์ํฉ์ ํฌ๊ฒ? ์์๊ฒ๊ฐ์์)
๊ทผ๋ฐ ๊ทธ๊ฑฐ ๋ค์ ๋ค์ฒ๋ฆฌ๋๊ฑฐ ํด๋ฆญํ๊ณ ๋ซ์๋
๋ชจ๋ฌ ๋ซํ๋ ๋ฐ๋ก input์น๊ตฌ๋ค ์ด๊ธฐํ ์ํด์ฃผ๋ฉด ๊ฐ์ ๋จ์์๋๋ผ๊ณ ์ ใ
ใ
ใ
ใ
์ด๊ฑด ์ฌ๋ด.. ์ ๋ฒํ๋ก์ ํธ๋ ๊ทธ๋์ ๋ฆฌ์
๋ก์ง ์ถ๊ฐํ์ด์..
|
|
||
| return createPortal( | ||
| <div className={styles.overlay}> | ||
| {modals.map((content, index) => ( |
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.
์ด๊ฑด ์ฌ๋ฌ๊ฐ์ ๋ชจ๋ฌ์ ๋์ฐ๋..๊ฑด๊ฐ์!?
๊ทผ๋ฐ ์ดํ์ผ์ด๋.. AlertModal์ด๋.. ๋ชจ๋ฌ์ด ๋๊ฐ ๊ฑด๊ฐ์...? ๋ชจ์ง..ใ
ใ
ใ
์ ์ดํด๊ฐ ์๊ฐ์ต๋๋ค....
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.
๊ป๋ฐ๊ธฐ๋ผ๊ณ ๋ณด๋ฉด ๋ฉ๋๋ค..
overlay๋ก ๋ฐฐ๊ฒฝ ๊ฒ๊ฒ ํด์ฃผ๊ณ
๊ทธ๋ฅ ์ง์ง ๋ชจ๋ฌ ์์ ๊ฐ์ด๋ฐ์ ์ก์์ฃผ๊ธฐ๋งํ๋???
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.
Alert๋ชจ๋ฌ์ ๊ทธ๋ฅ ๋น๋ฐ๋ฒํธ ์ค๋ฅ ์ฉ์ผ๋ก ๋ง๋ ๊ฑฐ๊ณ
์ด modal์ ๋ง์ฝ์ ์ฌ์ฉํ๋ค๊ณ ํ๋ฉด
EditModal, AddModal ์ด๋ ๊ฒ ๋ง๋ค์ด ์ง๊ฑฐ๊ฐ์ต๋๋ค.
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.
๊ป๋ฐ๊ธฐ....?๐ค
Modal ์ปดํฌ๋ํธ ํ๋๋ก ํ์น๊ธฐ์ ๋ฌด๋ฆฌ๊ฐ ์๋์?
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.
์ค์์ ๋๋ค... ๐ฑ
* โจ feat: add mypage layout and responsive CSS Implemented Modal component * ๐ fix: correct typo * ๐ fix: correct filename casing * ๐ก comment: temporarily comment out
* โจ feat: add mypage layout and responsive CSS Implemented Modal component * ๐ fix: correct typo * ๐ fix: correct filename casing * ๐ก comment: temporarily comment out
๐ Related Issue
๐ Description
๐ธ Screenshot
๋ชจ๋ฌ

๐ข Notes
๋ง์ํ์ ๋๋ก (with-header-sidebar)์ mypage ํด๋ ์ฎ๊ฒผ์ต๋๋ค.
ํด๋ ์ด์ฌ๋ฅผํด์ ํ์ผ์ฒด์ธ์ง๊ฐ ๋ง์ต๋๋ค....