diff --git a/components/Dialog/index.scss b/components/Dialog/index.scss index 04c6e1c2..c1d9f0b0 100644 --- a/components/Dialog/index.scss +++ b/components/Dialog/index.scss @@ -22,6 +22,7 @@ display: flex; align-items: center; gap: $unit; + justify-content: space-between; .left { display: flex; @@ -38,6 +39,7 @@ .DialogClose { background: transparent; + border: none; &:hover { cursor: pointer; @@ -58,7 +60,13 @@ .DialogTitle { color: var(--text-primary); font-size: $font-xlarge; - flex-grow: 1; + + h1 { + color: var(--text-primary); + font-size: $font-xlarge; + font-weight: $medium; + text-align: left; + } } .DialogTop { diff --git a/components/LoginModal/index.tsx b/components/LoginModal/index.tsx index fc38928f..e15c9008 100644 --- a/components/LoginModal/index.tsx +++ b/components/LoginModal/index.tsx @@ -4,13 +4,17 @@ import Router, { useRouter } from 'next/router' import { useTranslation } from 'react-i18next' import { AxiosResponse } from 'axios' -import * as Dialog from '@radix-ui/react-dialog' - import api from '~utils/api' import { accountState } from '~utils/accountState' import Button from '~components/Button' import Input from '~components/Input' +import { + Dialog, + DialogTrigger, + DialogContent, + DialogClose, +} from '~components/Dialog' import CrossIcon from '~public/icons/Cross.svg' import './index.scss' @@ -99,7 +103,7 @@ const LoginModal = (props: Props) => { .login(body) .then((response) => { storeCookieInfo(response) - return response.data.id + return response.data.user.id }) .then((id) => fetchUserInfo(id)) .then((infoResponse) => storeUserInfo(infoResponse)) @@ -111,12 +115,12 @@ const LoginModal = (props: Props) => { } function storeCookieInfo(response: AxiosResponse) { - const user = response.data + const resp = response.data const cookieObj: AccountCookie = { - userId: user.id, - username: user.username, - token: response.data.access_token, + userId: resp.user.id, + username: resp.user.username, + token: resp.access_token, } setCookie('account', cookieObj, { path: '/' }) @@ -165,51 +169,44 @@ const LoginModal = (props: Props) => { } return ( - - + +
  • {t('menu.login')}
  • -
    - - event.preventDefault()} - > -
    - - {t('modals.login.title')} - - - - - - + + +
    +
    +

    {t('modals.login.title')}

    + + + +
    -
    - + + - + - -
    - - - - + +