diff --git a/components/character/CharacterModal/index.tsx b/components/character/CharacterModal/index.tsx index 59e65c87..d00ca5a9 100644 --- a/components/character/CharacterModal/index.tsx +++ b/components/character/CharacterModal/index.tsx @@ -1,7 +1,7 @@ // Core dependencies import React, { PropsWithChildren, useEffect, useState } from 'react' import { useRouter } from 'next/router' -import { useTranslation } from 'next-i18next' +import { Trans, useTranslation } from 'next-i18next' import isEqual from 'lodash/isEqual' // UI dependencies @@ -57,16 +57,10 @@ const CharacterModal = ({ router.locale && ['en', 'ja'].includes(router.locale) ? router.locale : 'en' const { t } = useTranslation('common') - // UI state - const [open, setOpen] = useState(false) - const [formValid, setFormValid] = useState(false) - - // Refs - const headerRef = React.createRef() - const footerRef = React.createRef() - // State: Component + const [open, setOpen] = useState(false) const [alertOpen, setAlertOpen] = useState(false) + const [formValid, setFormValid] = useState(false) // State: Data const [perpetuity, setPerpetuity] = useState(false) @@ -81,6 +75,10 @@ const CharacterModal = ({ const [awakeningLevel, setAwakeningLevel] = useState(1) const [transcendenceStep, setTranscendenceStep] = useState(0) + // Refs + const headerRef = React.createRef() + const footerRef = React.createRef() + // Hooks useEffect(() => { setOpen(modalOpen) @@ -136,7 +134,7 @@ const CharacterModal = ({ return object } - // Methods: Convenience + // Methods: Modification checking function hasBeenModified() { const rings = ringsChanged() const aetherialMastery = aetherialMasteryChanged() @@ -272,11 +270,14 @@ const CharacterModal = ({ - You will lose all changes to{' '} - {gridCharacter.object.name[locale]} if you continue. -
-
- Are you sure you want to continue without saving? + + You will lose all changes to{' '} + {{ objectName: gridCharacter.object.name[locale] }}{' '} + if you continue. +
+
+ Are you sure you want to continue without saving? +
} open={alertOpen}