From af9064a35692f77dee9f40747916cb4ba5a33ad8 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Thu, 6 Jul 2023 19:22:11 -0700 Subject: [PATCH] Some fixes for scrollable dialogs on mobile This is 100% not going to scale to devices that are not my iPhone 14 Pro Max, but I can't get env variables working in CSS and something is better than nothing for right now. --- .../common/DialogContent/index.module.scss | 75 +------------------ components/common/DialogContent/index.tsx | 12 ++- .../common/DialogFooter/index.module.scss | 7 ++ .../filters/FilterModal/index.module.scss | 1 + components/filters/FilterModal/index.tsx | 3 +- 5 files changed, 25 insertions(+), 73 deletions(-) diff --git a/components/common/DialogContent/index.module.scss b/components/common/DialogContent/index.module.scss index d701ecab..92df55c2 100644 --- a/components/common/DialogContent/index.module.scss +++ b/components/common/DialogContent/index.module.scss @@ -15,6 +15,10 @@ @include breakpoint(phone) { place-items: flex-end; + overflow-y: hidden; + + &.filter { + } } .dialogContent { @@ -105,77 +109,6 @@ overflow-y: auto; } } - - &.Conflict { - $weapon-diameter: 14rem; - - .Content { - display: flex; - flex-direction: column; - gap: $unit-4x; - padding: $unit-4x $unit-4x $unit-2x $unit-4x; - - & > p { - font-size: $font-regular; - line-height: 1.4; - - strong { - font-weight: $bold; - } - - &:lang(ja) { - line-height: 1.4; - } - } - } - - .weapon, - .character { - display: flex; - flex-direction: column; - gap: $unit; - text-align: center; - width: $weapon-diameter; - font-weight: $medium; - - img { - border-radius: 1rem; - width: $weapon-diameter; - height: auto; - } - - span { - line-height: 1.3; - } - } - - footer { - display: flex; - flex-direction: row; - gap: $unit; - - .Button { - font-size: $font-regular; - padding: ($unit * 1.5) ($unit * 2); - width: 100%; - - &.btn-disabled { - background: $grey-90; - color: $grey-70; - cursor: not-allowed; - } - - &:not(.btn-disabled) { - background: $grey-90; - color: $grey-50; - - &:hover { - background: $grey-80; - } - } - } - } - } } @keyframes openModalDesktop { diff --git a/components/common/DialogContent/index.tsx b/components/common/DialogContent/index.tsx index 53703c7d..44823b3b 100644 --- a/components/common/DialogContent/index.tsx +++ b/components/common/DialogContent/index.tsx @@ -11,6 +11,7 @@ interface Props React.DialogHTMLAttributes, HTMLDivElement > { + wrapperClassName?: string headerref?: React.RefObject footerref?: React.RefObject scrollable?: boolean @@ -127,7 +128,16 @@ const DialogContent = React.forwardRef(function Dialog( return ( - + styles[className]) + )} + > { {props.children}