diff --git a/src/components/Modal/ConnectModal.tsx b/src/components/Modal/ConnectModal.tsx index 86bdefde..49847ffb 100644 --- a/src/components/Modal/ConnectModal.tsx +++ b/src/components/Modal/ConnectModal.tsx @@ -1,4 +1,4 @@ -import MainButton from 'components/Button/MainButton' +import ChupButton from 'components/core/Button/ChupButton' import Modal from 'components/Modal' import Spinner from 'components/Spinner' import CopySvg from 'images/icons/copy.svg' @@ -262,14 +262,14 @@ export default function ConnectModal() { ))} - { setOpen(false) }}> {t('Close')} - + ) : (
diff --git a/src/components/pages/profile/changingPasswordModal.tsx b/src/components/pages/profile/changingPasswordModal.tsx index 66686fb4..a23a9b52 100644 --- a/src/components/pages/profile/changingPasswordModal.tsx +++ b/src/components/pages/profile/changingPasswordModal.tsx @@ -1,6 +1,5 @@ import FilledButton from 'components/Button/FilledButton' import OutlineTextField from 'components/Input/TextField/Outline' -import Modal from 'components/Modal' import Image from 'next/image' import { useContext, useEffect, useRef, useState } from 'react' import { Context } from 'src/context' @@ -13,6 +12,7 @@ import Eye from 'assets/images/icons/eye.svg' import EyeClosed from 'assets/images/icons/eye_closed.svg' import MainButton from 'components/Button/MainButton' import ChupButton from 'components/core/Button/ChupButton' +import { Box, Modal } from '@mui/material' export default function ChangingPasswordModal({ open, setOpen }) { const [success, setSuccess] = useState(false) const [loading, setLoading] = useState(false) @@ -94,81 +94,100 @@ export default function ChangingPasswordModal({ open, setOpen }) { } return ( - -
-
-

{t('Change password')}

- { - if (e.which == 13) { - r1.current?.focus() - } - }} - type='password' - /> -
+ !success && setOpen(false)} + aria-labelledby="change-password-modal" + aria-describedby="modal-to-change-password" + > + +
+
+

{t('Change password')}

{ if (e.which == 13) { - r2.current?.focus() + r1.current?.focus() } }} - /> - - {repasswordValidateSuccess ? : null} -
- } - errorMsg={rePasswordError} - inputRef={r2} - placeholder={t('Re-enter new password')} /> -
- - {t('Confirm')} - -
-
-

{t('Successful password change')}!

- -
-

- {t('You can use the new password to log in Punkga now')} -

+
+ { + if (e.which == 13) { + r2.current?.focus() + } + }} + /> + + {repasswordValidateSuccess ? : null} +
+ } + errorMsg={rePasswordError} + inputRef={r2} + placeholder={t('Re-enter new password')} + /> +
{ - setOpen(false) - }}> - {t('Continue')} + loading={loading} + onClick={changePasswordHandler}> + {t('Confirm')}
+
+

{t('Successful password change')}!

+ +
+

+ {t('You can use the new password to log in Punkga now')} +

+ { + setOpen(false) + }}> + {t('Continue')} + +
+
-
+
) } diff --git a/src/components/pages/profile/newInfo.tsx b/src/components/pages/profile/newInfo.tsx index c444bd3f..b2f99545 100644 --- a/src/components/pages/profile/newInfo.tsx +++ b/src/components/pages/profile/newInfo.tsx @@ -26,6 +26,13 @@ const BorderLinearProgress = styled(LinearProgress)(({ theme }) => ({ }, })); +function formatDate(dateString) { + if (!dateString) return ''; + + const [year, month, day] = dateString.split('/'); + return `${day}/${month}/${year}`; +} + export default function NewInfo() { const router = useRouter() const { account, getProfile } = useContext(Context) @@ -200,7 +207,7 @@ export default function NewInfo() {
{t(account.gender)}
{account.gender ? '•' : ''}
- {account?.birthdate ? account.birthdate.replace(/-/g, '/') : ''} + {account?.birthdate ? formatDate(account.birthdate.replace(/-/g, '/')) : ''}
diff --git a/src/components/pages/profile/settingPasswordModal.tsx b/src/components/pages/profile/settingPasswordModal.tsx index 0bef3080..6ac68b7e 100644 --- a/src/components/pages/profile/settingPasswordModal.tsx +++ b/src/components/pages/profile/settingPasswordModal.tsx @@ -1,7 +1,5 @@ -import FilledButton from 'components/Button/FilledButton' -import MainButton from 'components/Button/MainButton' +import { Box, Modal } from '@mui/material' import OutlineTextField from 'components/Input/TextField/Outline' -import Modal from 'components/Modal' import ChupButton from 'components/core/Button/ChupButton' import SuccessImg from 'images/Mascot2.png' import CheckSquare from 'images/icons/check_square_fill.svg' @@ -72,60 +70,79 @@ export default function SettingPasswordModal({ open, setOpen, profile }) { } return ( - -
-
-

{t('Set password')}

-
- { - if (e.which == 13) { - r1.current?.focus() + !success && setOpen(false)} + aria-labelledby="change-password-modal" + aria-describedby="modal-to-change-password" + > + +
+
+

{t('Set password')}

+
+ { + if (e.which == 13) { + r1.current?.focus() + } + }} + /> + + {repasswordValidateSuccess ? : null} +
} - }} - /> - - {repasswordValidateSuccess ? : null} -
- } - errorMsg={rePasswordError} - placeholder={t('Re-enter new password')} - inputRef={r1} - /> + errorMsg={rePasswordError} + placeholder={t('Re-enter new password')} + inputRef={r1} + /> +
+ + {t('Confirm')} + +
+
+

{t('Password set')}!

+ +

+ {t('You can use the new password to log in Punkga now')} +

+ { + setOpen(false) + }}> + {t('Confirm')} +
- - {t('Confirm')} - -
-
-

{t('Password set')}!

- -

- {t('You can use the new password to log in Punkga now')} -

- { - setOpen(false) - }}> - {t('Confirm')} -
-
+
) }