From 0678856b4306bc8ff11a4d82dcc060927d68fb54 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 21 Jan 2023 07:56:25 -0800 Subject: [PATCH] Fix Conflict modals and make scrollable --- components/CharacterConflictModal/index.tsx | 69 ++++++++++++--------- components/DialogContent/index.scss | 36 ++++++++--- components/DialogContent/index.tsx | 2 +- components/WeaponConflictModal/index.tsx | 65 +++++++++++-------- 4 files changed, 109 insertions(+), 63 deletions(-) diff --git a/components/CharacterConflictModal/index.tsx b/components/CharacterConflictModal/index.tsx index 285260a5..535d6305 100644 --- a/components/CharacterConflictModal/index.tsx +++ b/components/CharacterConflictModal/index.tsx @@ -30,6 +30,9 @@ const CharacterConflictModal = (props: Props) => { // States const [open, setOpen] = useState(false) + // Refs + const footerRef = React.createRef() + useEffect(() => { setOpen(props.open) }, [setOpen, props.open]) @@ -73,42 +76,52 @@ const CharacterConflictModal = (props: Props) => { event.preventDefault()} onEscapeKeyDown={close} > -

- -

-
-
    - {props.conflictingCharacters?.map((character, i) => ( -
  • +
    +

    + +

    +
    +
      + {props.conflictingCharacters?.map((character, i) => ( +
    • + {character.object.name[locale]} + {character.object.name[locale]} +
    • + ))} +
    + +
    +
    {character.object.name[locale]} - {character.object.name[locale]} -
  • - ))} -
- -
-
- {props.incomingCharacter?.name[locale]} - {props.incomingCharacter?.name[locale]} + {props.incomingCharacter?.name[locale]} +
-
-
+
+
+
+
diff --git a/components/DialogContent/index.scss b/components/DialogContent/index.scss index f40bb59b..78d89ee6 100644 --- a/components/DialogContent/index.scss +++ b/components/DialogContent/index.scss @@ -149,6 +149,19 @@ flex-direction: column; padding: ($unit * 1.5) ($unit * $multiplier) $unit-3x; position: sticky; + + .Buttons { + display: flex; + gap: $unit; + + &.Span { + width: 100%; + + .Button { + width: 100%; + } + } + } } .actions { @@ -160,16 +173,23 @@ &.Conflict { $weapon-diameter: 14rem; - & > p { - line-height: 1.2; - max-width: 400px; + .Content { + display: flex; + flex-direction: column; + gap: $unit-4x; + padding: $unit-4x $unit-4x $unit-2x $unit-4x; - strong { - font-weight: $bold; - } - - &:lang(ja) { + & > p { + font-size: $font-regular; line-height: 1.4; + + strong { + font-weight: $bold; + } + + &:lang(ja) { + line-height: 1.4; + } } } diff --git a/components/DialogContent/index.tsx b/components/DialogContent/index.tsx index d2aabd2c..cc8a9b5e 100644 --- a/components/DialogContent/index.tsx +++ b/components/DialogContent/index.tsx @@ -11,7 +11,7 @@ interface Props React.DialogHTMLAttributes, HTMLDivElement > { - headerref: React.RefObject + headerref?: React.RefObject footerref?: React.RefObject onEscapeKeyDown: (event: KeyboardEvent) => void onOpenAutoFocus: (event: Event) => void diff --git a/components/WeaponConflictModal/index.tsx b/components/WeaponConflictModal/index.tsx index d1a9a3c7..a93f4345 100644 --- a/components/WeaponConflictModal/index.tsx +++ b/components/WeaponConflictModal/index.tsx @@ -30,6 +30,9 @@ const WeaponConflictModal = (props: Props) => { // States const [open, setOpen] = useState(false) + // Refs + const footerRef = React.createRef() + useEffect(() => { setOpen(props.open) }, [setOpen, props.open]) @@ -67,40 +70,50 @@ const WeaponConflictModal = (props: Props) => { event.preventDefault()} onEscapeKeyDown={close} > -

{infoString()}

-
-
    - {props.conflictingWeapons?.map((weapon, i) => ( -
  • +
    +

    {infoString()}

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