Added an alert for when remixing teams

This commit is contained in:
Justin Edmund 2023-04-16 03:52:10 -07:00
parent c365f857b0
commit ef5fd20497
3 changed files with 79 additions and 0 deletions

View file

@ -0,0 +1,57 @@
import React from 'react'
import { Trans, useTranslation } from 'next-i18next'
import Alert from '~components/common/Alert'
interface Props {
creator: boolean
name: string
open: boolean
remixCallback: () => void
onOpenChange: (open: boolean) => void
}
const RemixTeamAlert = ({
creator,
name,
open,
remixCallback,
onOpenChange,
}: Props) => {
const { t } = useTranslation('common')
function remixParty() {
remixCallback()
}
function close() {
onOpenChange(false)
}
return (
<Alert
open={open}
primaryAction={remixParty}
primaryActionText={t('modals.remix_team.buttons.confirm')}
cancelAction={close}
cancelActionText={t('modals.remix_team.buttons.cancel')}
message={
creator ? (
<Trans i18nKey="modals.remix_team.description.creator">
Remixing a team makes a copy of it in your account so you can make
your own changes.\n\nYou&apos;re already the creator of{' '}
<strong>{{ name: name }}</strong>, are you sure you want to remix
it?
</Trans>
) : (
<Trans i18nKey="modals.remix_team.description.viewer">
Remixing a team makes a copy of it in your account so you can make
your own changes.\n\nWould you like to remix{' '}
<strong>{{ name: 'HEY' }}</strong>?
</Trans>
)
}
/>
)
}
export default RemixTeamAlert

View file

@ -248,6 +248,17 @@
"password": "Password" "password": "Password"
} }
}, },
"remix_team": {
"title": "Remix team",
"description": {
"creator": "You're already the creator of <strong>{{name}}</strong>. Are you sure you want to make a copy by remixing it?",
"viewer": "Remixing a team makes a copy of it in your account so you can make your own changes.\n\nWould you like to remix <strong>{{name}}</strong>?"
},
"buttons": {
"confirm": "Yes, remix team",
"cancel": "Nevermind"
}
},
"settings": { "settings": {
"title": "Account Settings", "title": "Account Settings",
"labels": { "labels": {

View file

@ -248,6 +248,17 @@
"password": "パスワード" "password": "パスワード"
} }
}, },
"remix_team": {
"title": "編成をリミックス",
"description": {
"creator": "既に<strong>{{name}}</strong>の作家のため, 本当にリミックスでコピーを作成しますか?",
"viewer": "編成をリミックスすると変更をするために自アカウントにコピーを作成します。<strong>{{name}}</strong>をリミックスをしますか?"
},
"buttons": {
"confirm": "リミックス",
"cancel": "キャンセル"
}
},
"settings": { "settings": {
"title": "アカウント設定", "title": "アカウント設定",
"labels": { "labels": {