import React, { MouseEvent } from "react"; import { styled } from "styled-components"; import Flex from "../../components/Box/Flex"; import { MotionBox } from "../../components/Box"; import { ArrowBackIcon, CloseIcon } from "../../components/Svg"; import { IconButton } from "../../components/Button"; import { ModalProps } from "./types"; export const mobileFooterHeight = 73; export const ModalHeader = styled(Flex)<{ background?: string; headerBorderColor?: string }>` align-items: center; background: transparent; border-bottom: 1px solid ${({ theme, headerBorderColor }) => headerBorderColor || theme.colors.cardBorder}; display: flex; padding: 12px 24px; ${({ theme }) => theme.mediaQueries.md} { background: ${({ background }) => background || "transparent"}; } `; export const ModalTitle = styled(Flex)` align-items: center; flex: 1; `; export const ModalBody = styled(Flex)` flex-direction: column; overflow-y: auto; overflow-x: hidden; max-height: calc(90vh - ${mobileFooterHeight}px); ${({ theme }) => theme.mediaQueries.md} { display: flex; max-height: 90vh; } `; export const ModalCloseButton: React.FC> = ({ onDismiss, }) => { return ( ) => { e.stopPropagation(); onDismiss?.(); }} aria-label="Close the dialog" > ); }; export const ModalBackButton: React.FC> = ({ onBack }) => { return ( ); }; export const ModalContainer = styled(MotionBox)` overflow: hidden; background: ${({ theme }) => theme.modal.background}; box-shadow: 0px 20px 36px -8px rgba(14, 14, 44, 0.1), 0px 1px 1px rgba(0, 0, 0, 0.05); border: 1px solid ${({ theme }) => theme.colors.cardBorder}; border-radius: 32px 32px 0px 0px; width: 100%; max-height: calc(var(--vh, 1vh) * 100); z-index: ${({ theme }) => theme.zIndices.modal}; position: absolute; bottom: 0; max-width: none !important; min-height: 300px; ${({ theme }) => theme.mediaQueries.md} { width: auto; position: auto; bottom: auto; border-radius: 32px; max-height: 100vh; } ` as typeof MotionBox;