From 9d5d67601c5c0b615615c3082508ac89df5634db Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 2 Jan 2023 21:31:18 -0800 Subject: [PATCH] Use Dialog in ConflictModals --- components/CharacterConflictModal/index.tsx | 83 ++++++++++----------- components/WeaponConflictModal/index.tsx | 76 +++++++++---------- 2 files changed, 79 insertions(+), 80 deletions(-) diff --git a/components/CharacterConflictModal/index.tsx b/components/CharacterConflictModal/index.tsx index 6493b215..f6ab100f 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 { @@ -68,49 +68,48 @@ const CharacterConflictModal = (props: Props) => { } 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 5ace6a00..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' @@ -62,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]}
-
-
- - - - +
+
+
+ + + ) }