Skip to content

Commit

Permalink
Update modal styles on mobile (#898)
Browse files Browse the repository at this point in the history
Closes: AENG-36
Closes: AENG-37

This PR updates the modal component styles on mobile devices.
  • Loading branch information
kkosiorowska authored Nov 28, 2024
2 parents c217341 + b37293e commit 524e309
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dapp/src/components/MezoBeehiveModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function MezoBeehiveModalBase() {
</Flex>
</ModalHeader>

<ModalBody gap={6} pb={8} overflowX="hidden">
<ModalBody gap={6} pb={{ base: 0, sm: 8 }} overflowX="hidden">
<VStack spacing={1}>
{data && (
<HStack>
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/components/TransactionModal/ActionFormModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function ActionFormModal({ type }: { type: ActionFlowType }) {
<>
{!isLoading && <ModalCloseButton />}
<ModalHeader>{heading}</ModalHeader>
<ModalBody px={10}>
<ModalBody>
<Box w="100%">
<FormComponent onSubmitForm={handleSubmitFormWrapper} />
</Box>
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/components/TransactionModal/ResumeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function ResumeModal({ closeModal }: BaseModalProps) {

return (
<>
<ModalHeader pb={6} textAlign="center">
<ModalHeader pb={{ sm: 6 }} textAlign="center">
Paused
</ModalHeader>
<ModalBody textAlign="start" py={6} mx={3} gap={4}>
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/components/TransactionModal/SuccessModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function SuccessModal({ type }: SuccessModalProps) {
return (
<>
<ModalCloseButton />
<ModalHeader textAlign="center" pt={16}>
<ModalHeader textAlign="center" pt={{ sm: 16 }}>
{ACTION_FLOW_TYPES.UNSTAKE === type
? "Withdrawal initiated!"
: "Deposit received!"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default function WalletInteractionModal({
return (
<>
{step === "opening-wallet" && <ModalCloseButton />}
<ModalHeader textAlign="center" pt={16} pb={12}>
<ModalHeader textAlign="center" pt={{ sm: 16 }} pb={{ base: 4, sm: 12 }}>
{header}
</ModalHeader>
<ModalBody gap={12}>
Expand Down
2 changes: 1 addition & 1 deletion dapp/src/components/WelcomeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function WelcomeModalBase({ closeModal }: BaseModalProps) {
</TextSm>
{activeStepData.title}
</ModalHeader>
<ModalBody textAlign="left" display="block" color="brown.80" px="10">
<ModalBody textAlign="left" display="block" color="brown.80">
{activeStepData.content(embeddedApp)}
</ModalBody>
<ModalFooter
Expand Down
23 changes: 12 additions & 11 deletions dapp/src/theme/Modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ import { modalAnatomy as parts } from "@chakra-ui/anatomy"
import { createMultiStyleConfigHelpers, defineStyle } from "@chakra-ui/react"

const baseStyleContainer = defineStyle({
px: 8,
px: { base: 3, sm: 8 },
})

const baseStyleDialog = defineStyle({
marginTop: { base: 12, sm: "var(--chakra-space-modal_shift)" },
marginBottom: 8,
boxShadow: "none",
borderRadius: "xl",
p: { base: 5, sm: 0 },
bg: "gold.100",
border: "none",
})

const baseCloseButton = defineStyle({
top: -7,
right: -7,
boxSize: 7,
rounded: "100%",
top: { base: 3, sm: -7 },
right: { base: 3, sm: -7 },
boxSize: { sm: 7 },
rounded: { sm: "100%" },
bg: "opacity.white.5",

_hover: {
Expand All @@ -37,8 +38,8 @@ const baseStyleHeader = defineStyle({
fontSize: "xl",
lineHeight: "xl",
fontWeight: "bold",
pt: 10,
px: 10,
pt: { sm: 10 },
px: { sm: 10 },
pb: 8,
})

Expand All @@ -50,15 +51,15 @@ const baseStyleBody = defineStyle({
alignItems: "center",
gap: 6,
pt: 0,
px: 8,
pb: 10,
px: { base: 0, sm: 10 },
pb: { base: 0, sm: 10 },
})

const baseStyleFooter = defineStyle({
flexDirection: "column",
gap: 6,
px: 8,
pb: 10,
px: { base: 0, sm: 8 },
pb: { base: 0, sm: 10 },
})

const multiStyleConfig = createMultiStyleConfigHelpers(parts.keys)
Expand Down

0 comments on commit 524e309

Please sign in to comment.