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 (
+
+ }
+ className="New"
+ blended={true}
+ text={t('buttons.new')}
+ onClick={newTeam}
+ />
+
+ )
+ }
+
const remixButton = () => {
return (
@@ -396,6 +411,7 @@ const Header = () => {
{router.route === '/p/[party]' && !appState.errorCode
? remixButton()
: ''}
+ {newButton()}
{
{account.user ? `@${account.user.username}` : t('no_user')}
-
-
- handleNewParty(e, '/new')}>
- {t('menu.new')}
-
-
-
{t('menu.profile')}
@@ -513,16 +522,6 @@ const Header = () => {
} else {
items = (
<>
-
-
-
- handleNewParty(e, '/new')}>
- {t('menu.new')}
-
-
-
-
-