Commit 9f4a1f48 authored by cartcrom's avatar cartcrom Committed by GitHub

feat: fixed modal positioning on mobile & updated theming (#5790)

* feat: fixed modal positioning on mobile & updated theming

* fix: undid spacing change
parent de953339
...@@ -17,6 +17,9 @@ const StyledDialogOverlay = styled(AnimatedDialogOverlay)<{ $scrollOverlay?: boo ...@@ -17,6 +17,9 @@ const StyledDialogOverlay = styled(AnimatedDialogOverlay)<{ $scrollOverlay?: boo
display: flex; display: flex;
align-items: center; align-items: center;
@media screen and (max-width: ${({ theme }) => theme.breakpoint.sm}px) {
align-items: flex-end;
}
overflow-y: ${({ $scrollOverlay }) => $scrollOverlay && 'scroll'}; overflow-y: ${({ $scrollOverlay }) => $scrollOverlay && 'scroll'};
justify-content: center; justify-content: center;
...@@ -27,7 +30,6 @@ const StyledDialogOverlay = styled(AnimatedDialogOverlay)<{ $scrollOverlay?: boo ...@@ -27,7 +30,6 @@ const StyledDialogOverlay = styled(AnimatedDialogOverlay)<{ $scrollOverlay?: boo
type StyledDialogProps = { type StyledDialogProps = {
$minHeight?: number | false $minHeight?: number | false
$maxHeight?: number $maxHeight?: number
$isBottomSheet?: boolean
$scrollOverlay?: boolean $scrollOverlay?: boolean
$hideBorder?: boolean $hideBorder?: boolean
$maxWidth: number $maxWidth: number
...@@ -40,14 +42,12 @@ const StyledDialogContent = styled(AnimatedDialogContent)<StyledDialogProps>` ...@@ -40,14 +42,12 @@ const StyledDialogContent = styled(AnimatedDialogContent)<StyledDialogProps>`
&[data-reach-dialog-content] { &[data-reach-dialog-content] {
margin: auto; margin: auto;
background-color: ${({ theme }) => theme.backgroundSurface}; background-color: ${({ theme }) => theme.backgroundSurface};
border: ${({ theme, $hideBorder }) => !$hideBorder && `1px solid ${theme.deprecated_bg1}`}; border: ${({ theme, $hideBorder }) => !$hideBorder && `1px solid ${theme.backgroundOutline}`};
box-shadow: ${({ theme }) => theme.deepShadow}; box-shadow: ${({ theme }) => theme.deepShadow};
padding: 0px; padding: 0px;
width: 50vw; width: 50vw;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
align-self: ${({ $isBottomSheet }) => $isBottomSheet && 'flex-end'};
max-width: ${({ $maxWidth }) => $maxWidth}px; max-width: ${({ $maxWidth }) => $maxWidth}px;
${({ $maxHeight }) => ${({ $maxHeight }) =>
$maxHeight && $maxHeight &&
...@@ -61,22 +61,17 @@ const StyledDialogContent = styled(AnimatedDialogContent)<StyledDialogProps>` ...@@ -61,22 +61,17 @@ const StyledDialogContent = styled(AnimatedDialogContent)<StyledDialogProps>`
`} `}
display: ${({ $scrollOverlay }) => ($scrollOverlay ? 'inline-table' : 'flex')}; display: ${({ $scrollOverlay }) => ($scrollOverlay ? 'inline-table' : 'flex')};
border-radius: 20px; border-radius: 20px;
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToMedium`
@media screen and (max-width: ${({ theme }) => theme.breakpoint.md}px) {
width: 65vw; width: 65vw;
margin: auto; }
`} @media screen and (max-width: ${({ theme }) => theme.breakpoint.sm}px) {
${({ theme, $isBottomSheet }) => theme.deprecated_mediaWidth.deprecated_upToSmall` margin: 0;
width: 85vw;
${
$isBottomSheet &&
css`
width: 100vw; width: 100vw;
border-radius: 20px; border-radius: 20px;
border-bottom-left-radius: 0; border-bottom-left-radius: 0;
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
`
} }
`}
} }
` `
...@@ -91,7 +86,6 @@ interface ModalProps { ...@@ -91,7 +86,6 @@ interface ModalProps {
children?: React.ReactNode children?: React.ReactNode
$scrollOverlay?: boolean $scrollOverlay?: boolean
hideBorder?: boolean hideBorder?: boolean
isBottomSheet?: boolean
} }
export default function Modal({ export default function Modal({
...@@ -104,7 +98,6 @@ export default function Modal({ ...@@ -104,7 +98,6 @@ export default function Modal({
children, children,
onSwipe = onDismiss, onSwipe = onDismiss,
$scrollOverlay, $scrollOverlay,
isBottomSheet = isMobile,
hideBorder = false, hideBorder = false,
}: ModalProps) { }: ModalProps) {
const fadeTransition = useTransition(isOpen, { const fadeTransition = useTransition(isOpen, {
...@@ -148,7 +141,6 @@ export default function Modal({ ...@@ -148,7 +141,6 @@ export default function Modal({
aria-label="dialog" aria-label="dialog"
$minHeight={minHeight} $minHeight={minHeight}
$maxHeight={maxHeight} $maxHeight={maxHeight}
$isBottomSheet={isBottomSheet}
$scrollOverlay={$scrollOverlay} $scrollOverlay={$scrollOverlay}
$hideBorder={hideBorder} $hideBorder={hideBorder}
$maxWidth={maxWidth} $maxWidth={maxWidth}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment