From 013d6d5bfbe5126f9fdf131675f290dc03b528b9 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 31 Jan 2023 18:01:22 -0800 Subject: [PATCH] Add new button back --- components/Header/index.tsx | 59 +++++++++++++++++------------------ public/locales/en/common.json | 1 + public/locales/ja/common.json | 1 + 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/components/Header/index.tsx b/components/Header/index.tsx index 35af54c6..2a9adfe5 100644 --- a/components/Header/index.tsx +++ b/components/Header/index.tsx @@ -1,6 +1,5 @@ import React, { useEffect, useState } from 'react' import { subscribe, useSnapshot } from 'valtio' -import { subscribeKey } from 'valtio/utils' import { deleteCookie } from 'cookies-next' import { useRouter } from 'next/router' import { Trans, useTranslation } from 'next-i18next' @@ -31,6 +30,7 @@ import ArrowIcon from '~public/icons/Arrow.svg' import LinkIcon from '~public/icons/Link.svg' import MenuIcon from '~public/icons/Menu.svg' import RemixIcon from '~public/icons/Remix.svg' +import PlusIcon from '~public/icons/Add.svg' import SaveIcon from '~public/icons/Save.svg' import './index.scss' @@ -114,19 +114,9 @@ const Header = () => { } // Methods: Actions - function handleNewParty(event: React.MouseEvent, path: string) { + function handleNewTeam(event: React.MouseEvent) { event.preventDefault() - - // Clean state - const resetState = clonedeep(initialAppState) - Object.keys(resetState).forEach((key) => { - appState[key] = resetState[key] - }) - - // Push the root URL - router.push(path) - - // Close right menu + newTeam() closeRightMenu() } @@ -165,6 +155,17 @@ const Header = () => { return false } + function newTeam() { + // Clean state + const resetState = clonedeep(initialAppState) + Object.keys(resetState).forEach((key) => { + appState[key] = resetState[key] + }) + + // Push the root URL + router.push('/new') + } + function remixTeam() { setOriginalName(partySnapshot.name ? partySnapshot.name : t('no_title')) @@ -281,6 +282,20 @@ const Header = () => { ) } + const newButton = () => { + return ( + +