diff --git a/components/BottomHeader/index.tsx b/components/BottomHeader/index.tsx index 93eff8af..eaaec479 100644 --- a/components/BottomHeader/index.tsx +++ b/components/BottomHeader/index.tsx @@ -2,6 +2,8 @@ import React from 'react' import { useRouter } from 'next/router' import { useCookies } from 'react-cookie' import { useSnapshot } from 'valtio' +import { useTranslation } from 'next-i18next' + import clonedeep from 'lodash.clonedeep' import * as Scroll from 'react-scroll' @@ -11,15 +13,13 @@ import Header from '~components/Header' import Button from '~components/Button' import api from '~utils/api' -import { accountState } from '~utils/accountState' import { appState, initialAppState } from '~utils/appState' -import { ButtonType } from '~utils/enums' import CrossIcon from '~public/icons/Cross.svg' -import { route } from 'next/dist/server/router' const BottomHeader = () => { - const account = useSnapshot(accountState) + const { t } = useTranslation('common') + const app = useSnapshot(appState) const router = useRouter() @@ -67,9 +67,9 @@ const BottomHeader = () => { const leftNav = () => { if (router.pathname === '/p/[party]' || router.pathname === '/new') { if (app.party.detailsVisible) { - return () + return () } else { - return () + return () } } else { return (
) @@ -84,20 +84,20 @@ const BottomHeader = () => { - Delete team + {t('buttons.delete')} - Delete team + {t('delete_team.title')} - Are you sure you want to permanently delete this team? + {t('delete_team.description')}
- Nevermind - deleteTeam(e)}>Yes, delete + {t('delete_team.buttons.cancel')} + deleteTeam(e)}>{t('delete_team.buttons.confirm')}
diff --git a/components/TopHeader/index.tsx b/components/TopHeader/index.tsx index 4f5f8977..c7915304 100644 --- a/components/TopHeader/index.tsx +++ b/components/TopHeader/index.tsx @@ -1,8 +1,10 @@ import React, { useEffect } from 'react' +import { useSnapshot } from 'valtio' import { useCookies } from 'react-cookie' import { useRouter } from 'next/router' +import { useTranslation } from 'next-i18next' + import clonedeep from 'lodash.clonedeep' -import { useSnapshot } from 'valtio' import api from '~utils/api' import { accountState, initialAccountState } from '~utils/accountState' @@ -13,6 +15,8 @@ import Button from '~components/Button' import HeaderMenu from '~components/HeaderMenu' const TopHeader = () => { + const { t } = useTranslation('common') + // Cookies const [accountCookies, setAccountCookie, removeAccountCookie] = useCookies(['account']) const [userCookies, setUserCookies, removeUserCookie] = useCookies(['user']) @@ -100,7 +104,7 @@ const TopHeader = () => { const leftNav = () => { return (
- + { (account.user) ? : @@ -123,9 +127,9 @@ const TopHeader = () => { saveButton() : '' } { (router.route === '/p/[party]') ? - : '' + : '' } - +
) }