Added an alert for when remixing teams
This commit is contained in:
parent
c365f857b0
commit
ef5fd20497
3 changed files with 79 additions and 0 deletions
57
components/dialogs/RemixTeamAlert/index.tsx
Normal file
57
components/dialogs/RemixTeamAlert/index.tsx
Normal 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'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
|
||||
|
|
@ -248,6 +248,17 @@
|
|||
"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": {
|
||||
"title": "Account Settings",
|
||||
"labels": {
|
||||
|
|
|
|||
|
|
@ -248,6 +248,17 @@
|
|||
"password": "パスワード"
|
||||
}
|
||||
},
|
||||
"remix_team": {
|
||||
"title": "編成をリミックス",
|
||||
"description": {
|
||||
"creator": "既に<strong>{{name}}</strong>の作家のため, 本当にリミックスでコピーを作成しますか?",
|
||||
"viewer": "編成をリミックスすると変更をするために自アカウントにコピーを作成します。<strong>{{name}}</strong>をリミックスをしますか?"
|
||||
},
|
||||
"buttons": {
|
||||
"confirm": "リミックス",
|
||||
"cancel": "キャンセル"
|
||||
}
|
||||
},
|
||||
"settings": {
|
||||
"title": "アカウント設定",
|
||||
"labels": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue