Add Remix button

This commit is contained in:
Justin Edmund 2023-01-27 23:11:33 -08:00
parent c224184dee
commit f2a1d80bf2

View file

@ -146,6 +146,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
@ -238,7 +246,7 @@ const Header = () => {
className="Remix"
blended={true}
text="Remix"
onClick={toggleFavorite}
onClick={remixTeam}
/>
)
}
@ -305,7 +313,7 @@ const Header = () => {
(!party.user || party.user.id !== account.user.id)
? saveButton()
: ''}
{remixButton()}
{router.route === '/p/[party]' ? remixButton() : ''}
<DropdownMenu
open={rightMenuOpen}
onOpenChange={handleRightMenuOpenChange}