Skip to content

Commit c982e46

Browse files
committed
feat: add isLandscapeView prop to ConfirmationModal for responsive width adjustment
1 parent ea89969 commit c982e46

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const ConfirmationModalBody = ({
3939
handleClose,
4040
shouldCloseOnEscape = true,
4141
overriddenTheme,
42+
isLandscapeView = false,
4243
}: ConfirmationModalBodyProps) => {
4344
const { registerShortcut, unregisterShortcut } = useRegisterShortcut()
4445

@@ -83,7 +84,7 @@ const ConfirmationModalBody = ({
8384
return (
8485
<Backdrop onEscape={shouldCloseOnEscape ? handleCloseWrapper : noop}>
8586
<motion.div
86-
className={`${overriddenTheme ? getComponentSpecificThemeClass(overriddenTheme) : ''} confirmation-modal border__secondary flexbox-col br-8 bg__primary dc__m-auto mt-40 w-400`}
87+
className={`${overriddenTheme ? getComponentSpecificThemeClass(overriddenTheme) : ''} ${isLandscapeView ? 'w-500' : 'w-400'} confirmation-modal border__secondary flexbox-col br-8 bg__primary dc__m-auto mt-40 w-400`}
8788
exit={{ y: 100, opacity: 0, scale: 0.75, transition: { duration: 0.35 } }}
8889
initial={{ y: 100, opacity: 0, scale: 0.75 }}
8990
animate={{ y: 0, opacity: 1, scale: 1 }}
@@ -96,7 +97,7 @@ const ConfirmationModalBody = ({
9697
className: `${RenderIcon.props?.className ?? ''} icon-dim-48 dc__no-shrink`,
9798
})}
9899

99-
<div className="flexbox-col dc__gap-8">
100+
<div className={`flexbox-col ${isLandscapeView ? '' : 'dc__gap-8'}`}>
100101
<span className="cn-9 fs-16 fw-6 lh-24 dc__word-break">{title}</span>
101102

102103
{typeof subtitle === 'string' ? (

src/Shared/Components/ConfirmationModal/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ export type ConfirmationModalProps<isConfig extends boolean = false> = PropsWith
9999
* If provided, the modal will use the specified theme instead of using the theme set by theme provider.
100100
*/
101101
overriddenTheme?: AppThemeType
102+
/**
103+
* @default false
104+
* @deprecated Used to extend the width to 500px and remove gap between title and subTitle.
105+
*/
106+
isLandscapeView?: boolean
102107
}> &
103108
ButtonConfigAndVariantType<isConfig> &
104109
(isConfig extends false

0 commit comments

Comments
 (0)