diff --git a/components/Button/index.scss b/components/Button/index.scss index 585fb876..994bb041 100644 --- a/components/Button/index.scss +++ b/components/Button/index.scss @@ -31,6 +31,15 @@ background: transparent; } + &.IconButton.medium { + height: inherit; + padding: $unit-half; + + &:hover { + background: none; + } + } + &.Contained { background: var(--button-contained-bg); diff --git a/components/Header/index.tsx b/components/Header/index.tsx index 6502f89f..40b32fe9 100644 --- a/components/Header/index.tsx +++ b/components/Header/index.tsx @@ -9,7 +9,7 @@ import Link from 'next/link' import api from '~utils/api' import { accountState, initialAccountState } from '~utils/accountState' -import { appState, initialAppState } from '~utils/appState' +import { appState } from '~utils/appState' import capitalizeFirstLetter from '~utils/capitalizeFirstLetter' import { @@ -26,12 +26,14 @@ import AccountModal from '~components/AccountModal' import Toast from '~components/Toast' import Button from '~components/Button' +import ArrowIcon from '~public/icons/Arrow.svg' import LinkIcon from '~public/icons/Link.svg' import MenuIcon from '~public/icons/Menu.svg' -import ArrowIcon from '~public/icons/Arrow.svg' +import RemixIcon from '~public/icons/Remix.svg' import SaveIcon from '~public/icons/Save.svg' import './index.scss' +import Tooltip from '~components/Tooltip' const Header = () => { // Localization @@ -83,10 +85,6 @@ const Header = () => { setRightMenuOpen(false) } - function handleSettingsOpenChanged(open: boolean) { - setRightMenuOpen(false) - } - function copyToClipboard() { const el = document.createElement('input') el.value = window.location.href @@ -106,15 +104,6 @@ const Header = () => { // Push the root URL router.push(path) - // Clean state - const resetState = clonedeep(initialAppState) - Object.keys(resetState).forEach((key) => { - appState[key] = resetState[key] - }) - - // Set party to be editable - appState.party.editable = true - // Close right menu closeRightMenu() } @@ -158,6 +147,14 @@ const Header = () => { else console.error('Failed to unsave team: No party ID') } + function remixTeam() { + if (party.shortcode) + api.remix(party.shortcode).then((response) => { + const remix = response.data.party + router.push(`/p/${remix.shortcode}`) + }) + } + const pageTitle = () => { let title = '' let hasAccessory = false @@ -219,7 +216,7 @@ const Header = () => { open={copyToastOpen} duration={2400} type="foreground" - content="This party's URL was copied to your clipboard" + content={t('toasts.copied')} onOpenChange={handleCopyToastOpenChanged} onCloseClick={handleCopyToastCloseClicked} /> @@ -228,16 +225,32 @@ const Header = () => { const saveButton = () => { return ( -