From ef5fd20497e022da1d29e33f6ef5b87526d682df Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 16 Apr 2023 03:52:10 -0700 Subject: [PATCH] Added an alert for when remixing teams --- components/dialogs/RemixTeamAlert/index.tsx | 57 +++++++++++++++++++++ public/locales/en/common.json | 11 ++++ public/locales/ja/common.json | 11 ++++ 3 files changed, 79 insertions(+) create mode 100644 components/dialogs/RemixTeamAlert/index.tsx diff --git a/components/dialogs/RemixTeamAlert/index.tsx b/components/dialogs/RemixTeamAlert/index.tsx new file mode 100644 index 00000000..739e631a --- /dev/null +++ b/components/dialogs/RemixTeamAlert/index.tsx @@ -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 ( + + 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{' '} + {{ name: name }}, are you sure you want to remix + it? + + ) : ( + + 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' }}? + + ) + } + /> + ) +} + +export default RemixTeamAlert diff --git a/public/locales/en/common.json b/public/locales/en/common.json index d6c0ce1b..aee4f087 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -248,6 +248,17 @@ "password": "Password" } }, + "remix_team": { + "title": "Remix team", + "description": { + "creator": "You're already the creator of {{name}}. 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 {{name}}?" + }, + "buttons": { + "confirm": "Yes, remix team", + "cancel": "Nevermind" + } + }, "settings": { "title": "Account Settings", "labels": { diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index bc1503d7..0f7064f0 100644 --- a/public/locales/ja/common.json +++ b/public/locales/ja/common.json @@ -248,6 +248,17 @@ "password": "パスワード" } }, + "remix_team": { + "title": "編成をリミックス", + "description": { + "creator": "既に{{name}}の作家のため, 本当にリミックスでコピーを作成しますか?", + "viewer": "編成をリミックスすると変更をするために自アカウントにコピーを作成します。{{name}}をリミックスをしますか?" + }, + "buttons": { + "confirm": "リミックス", + "cancel": "キャンセル" + } + }, "settings": { "title": "アカウント設定", "labels": {