diff --git a/components/CharacterConflictModal/index.tsx b/components/CharacterConflictModal/index.tsx index 6493b215..b14fed31 100644 --- a/components/CharacterConflictModal/index.tsx +++ b/components/CharacterConflictModal/index.tsx @@ -2,12 +2,12 @@ import React, { useEffect, useState } from 'react' import { useRouter } from 'next/router' import { Trans, useTranslation } from 'next-i18next' -import * as Dialog from '@radix-ui/react-dialog' +import { Dialog, DialogContent } from '~components/Dialog' +import Button from '~components/Button' +import Overlay from '~components/Overlay' import { appState } from '~utils/appState' -import Button from '~components/Button' - import './index.scss' interface Props { @@ -65,52 +65,52 @@ const CharacterConflictModal = (props: Props) => { function close() { setOpen(false) + props.resetConflict() } return ( - - - event.preventDefault()} - > -

- -

-
-
    - {props.conflictingCharacters?.map((character, i) => ( -
  • - {character.object.name[locale]} - {character.object.name[locale]} -
  • - ))} -
- -
-
+ + event.preventDefault()} + onEscapeKeyDown={close} + > +

+ +

+
+
    + {props.conflictingCharacters?.map((character, i) => ( +
  • {props.incomingCharacter?.name[locale]} - {props.incomingCharacter?.name[locale]} -
+ {character.object.name[locale]} + + ))} + + +
+
+ {props.incomingCharacter?.name[locale]} + {props.incomingCharacter?.name[locale]}
-
-
- - - - +
+
+
+ + + ) } diff --git a/components/WeaponConflictModal/index.tsx b/components/WeaponConflictModal/index.tsx index 84bd3541..ce7b6620 100644 --- a/components/WeaponConflictModal/index.tsx +++ b/components/WeaponConflictModal/index.tsx @@ -2,8 +2,9 @@ import React, { useEffect, useState } from 'react' import { useRouter } from 'next/router' import { Trans, useTranslation } from 'react-i18next' -import * as Dialog from '@radix-ui/react-dialog' +import { Dialog, DialogContent } from '~components/Dialog' import Button from '~components/Button' +import Overlay from '~components/Overlay' import mapWeaponSeries from '~utils/mapWeaponSeries' @@ -43,6 +44,7 @@ const WeaponConflictModal = (props: Props) => { function close() { setOpen(false) + props.resetConflict() } const infoString = () => { @@ -61,47 +63,46 @@ const WeaponConflictModal = (props: Props) => { } return ( - - - event.preventDefault()} - > -

{infoString()}

-
-
    - {props.conflictingWeapons?.map((weapon, i) => ( -
  • - {weapon.object.name[locale]} - {weapon.object.name[locale]} -
  • - ))} -
- -
-
+ + event.preventDefault()} + onEscapeKeyDown={close} + > +

{infoString()}

+
+
    + {props.conflictingWeapons?.map((weapon, i) => ( +
  • {props.incomingWeapon?.name[locale]} - {props.incomingWeapon?.name[locale]} -
+ {weapon.object.name[locale]} + + ))} + + +
+
+ {props.incomingWeapon?.name[locale]} + {props.incomingWeapon?.name[locale]}
-
-
- - - - +
+
+
+ + + ) } diff --git a/components/WeaponHovercard/index.tsx b/components/WeaponHovercard/index.tsx index db7f002a..fa9afe3b 100644 --- a/components/WeaponHovercard/index.tsx +++ b/components/WeaponHovercard/index.tsx @@ -80,7 +80,7 @@ const WeaponHovercard = (props: Props) => { } const createPrimaryAxSkillString = () => { - const primaryAxSkills = axData[props.gridWeapon.object.ax - 1] + const primaryAxSkills = axData[props.gridWeapon.object.ax_type - 1] if (props.gridWeapon.ax) { const simpleAxSkill = props.gridWeapon.ax[0] @@ -97,7 +97,7 @@ const WeaponHovercard = (props: Props) => { } const createSecondaryAxSkillString = () => { - const primaryAxSkills = axData[props.gridWeapon.object.ax - 1] + const primaryAxSkills = axData[props.gridWeapon.object.ax_type - 1] if (props.gridWeapon.ax) { const primarySimpleAxSkill = props.gridWeapon.ax[0] @@ -230,7 +230,7 @@ const WeaponHovercard = (props: Props) => {
- {props.gridWeapon.object.ax > 0 && + {props.gridWeapon.object.ax && props.gridWeapon.ax && props.gridWeapon.ax[0].modifier && props.gridWeapon.ax[0].strength diff --git a/components/WeaponModal/index.tsx b/components/WeaponModal/index.tsx index 8fb178ae..cb88311f 100644 --- a/components/WeaponModal/index.tsx +++ b/components/WeaponModal/index.tsx @@ -148,7 +148,7 @@ const WeaponModal = (props: Props) => { if (props.gridWeapon.object.series == 17 && weaponKey3Id) object.weapon.weapon_key3_id = weaponKey3Id - if (props.gridWeapon.object.ax > 0) { + if (props.gridWeapon.object.ax && props.gridWeapon.object.ax_type > 0) { object.weapon.ax_modifier1 = primaryAxModifier object.weapon.ax_modifier2 = secondaryAxModifier object.weapon.ax_strength1 = primaryAxValue @@ -287,7 +287,7 @@ const WeaponModal = (props: Props) => {

{t('modals.weapon.subtitles.ax_skills')}

{ } function openChange(open: boolean) { - if (props.gridWeapon.object.ax > 0 || props.gridWeapon.object.awakening) { + if (props.gridWeapon.object.ax || props.gridWeapon.object.awakening) { setFormValid(false) } else { setFormValid(true) @@ -369,7 +369,7 @@ const WeaponModal = (props: Props) => { {[2, 3, 17, 24].includes(props.gridWeapon.object.series) ? keySelect() : ''} - {props.gridWeapon.object.ax > 0 ? axSelect() : ''} + {props.gridWeapon.object.ax ? axSelect() : ''} {props.gridWeapon.awakening ? awakeningSelect() : ''}