diff --git a/components/dialogs/RemixTeamAlert/index.tsx b/components/dialogs/RemixTeamAlert/index.tsx index 739e631a..528181f4 100644 --- a/components/dialogs/RemixTeamAlert/index.tsx +++ b/components/dialogs/RemixTeamAlert/index.tsx @@ -46,7 +46,7 @@ const RemixTeamAlert = ({ Remixing a team makes a copy of it in your account so you can make your own changes.\n\nWould you like to remix{' '} - {{ name: 'HEY' }}? + {{ name: name }}? ) } diff --git a/components/party/PartyDropdown/index.tsx b/components/party/PartyDropdown/index.tsx index 12791e4b..bd0993f0 100644 --- a/components/party/PartyDropdown/index.tsx +++ b/components/party/PartyDropdown/index.tsx @@ -131,7 +131,7 @@ const PartyDropdown = ({ setCopyToastOpen(false) } - // Toasts / Remix team + // Toasts: Remix team function handleRemixToastOpenChanged(open: boolean) { setRemixToastOpen(!open) } @@ -140,6 +140,11 @@ const PartyDropdown = ({ setRemixToastOpen(false) } + function remixCallback() { + setRemixToastOpen(true) + remixTeamCallback() + } + const editableItems = () => { return ( <> @@ -184,17 +189,19 @@ const PartyDropdown = ({ + + { const { party: partySnapshot } = useSnapshot(appState) - const [name, setName] = useState('') + // State: Component + const [remixAlertOpen, setRemixAlertOpen] = useState(false) + const [remixToastOpen, setRemixToastOpen] = useState(false) + // State: Data + const [name, setName] = useState('') const [chargeAttack, setChargeAttack] = useState(true) const [fullAuto, setFullAuto] = useState(false) const [autoGuard, setAutoGuard] = useState(false) const [autoSummon, setAutoSummon] = useState(false) - const [buttonCount, setButtonCount] = useState(undefined) const [chainCount, setChainCount] = useState(undefined) const [turnCount, setTurnCount] = useState(undefined) @@ -157,6 +163,32 @@ const PartyHeader = (props: Props) => { ) } + // Actions: Remix team + function remixTeamCallback() { + setRemixToastOpen(true) + props.remixCallback() + } + + // Alerts: Remix team + function openRemixTeamAlert() { + setRemixAlertOpen(true) + } + + function handleRemixTeamAlertChange(open: boolean) { + setRemixAlertOpen(open) + } + + // Toasts: Remix team + function handleRemixToastOpenChanged(open: boolean) { + setRemixToastOpen(!open) + } + + function handleRemixToastCloseClicked() { + setRemixToastOpen(false) + } + + // Rendering + const userBlock = (username?: string, picture?: string, element?: string) => { return (
@@ -354,7 +386,7 @@ const PartyHeader = (props: Props) => { leftAccessoryIcon={} className="Remix" text={t('buttons.remix')} - onClick={props.remixCallback} + onClick={openRemixTeamAlert} /> ) @@ -423,6 +455,21 @@ const PartyHeader = (props: Props) => {
{renderTokens()}
+ + + + ) } diff --git a/components/toasts/RemixedToast/index.tsx b/components/toasts/RemixedToast/index.tsx index d77a5c76..e1c4b3d9 100644 --- a/components/toasts/RemixedToast/index.tsx +++ b/components/toasts/RemixedToast/index.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useEffect } from 'react' import Toast from '~components/common/Toast' import { Trans, useTranslation } from 'next-i18next' @@ -17,7 +17,9 @@ const RemixedToast = ({ onCloseClick, }: Props) => { const { t } = useTranslation('common') - + useEffect(() => { + console.log(partyName) + }, []) // Methods: Event handlers function handleOpenChange() { onOpenChange(open)