Skip to content

Commit 6163255

Browse files
committed
refactor: remove overriddenTheme prop from ConfirmationModal and update theme preference storage key
1 parent 57c209a commit 6163255

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

src/Shared/Components/ConfirmationModal/ConfirmationModal.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { AnimatePresence, motion } from 'framer-motion'
1919
import { noop, stopPropagation, useRegisterShortcut, UseRegisterShortcutProvider } from '@Common/index'
2020
import { ComponentSizeType } from '@Shared/constants'
2121
import { getUniqueId } from '@Shared/Helpers'
22-
import { getComponentSpecificThemeClass } from '@Shared/index'
2322
import { ConfirmationModalBodyProps, ConfirmationModalProps, ConfirmationModalVariantType } from './types'
2423
import { getPrimaryButtonStyleFromVariant, getConfirmationLabel, getIconFromVariant } from './utils'
2524
import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
@@ -38,7 +37,6 @@ const ConfirmationModalBody = ({
3837
children,
3938
handleClose,
4039
shouldCloseOnEscape = true,
41-
overriddenTheme,
4240
isLandscapeView = false,
4341
}: ConfirmationModalBodyProps) => {
4442
const { registerShortcut, unregisterShortcut } = useRegisterShortcut()
@@ -84,7 +82,7 @@ const ConfirmationModalBody = ({
8482
return (
8583
<Backdrop onEscape={shouldCloseOnEscape ? handleCloseWrapper : noop}>
8684
<motion.div
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`}
85+
className={`${isLandscapeView ? 'w-500' : 'w-400'} confirmation-modal border__secondary flexbox-col br-8 bg__primary dc__m-auto mt-40 w-400`}
8886
exit={{ y: 100, opacity: 0, scale: 0.75, transition: { duration: 0.35 } }}
8987
initial={{ y: 100, opacity: 0, scale: 0.75 }}
9088
animate={{ y: 0, opacity: 1, scale: 1 }}

src/Shared/Components/ConfirmationModal/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
SetStateAction,
2424
SyntheticEvent,
2525
} from 'react'
26-
import { AppThemeType } from '@Shared/index'
2726
import { ButtonProps } from '../Button'
2827

2928
export enum ConfirmationModalVariantType {
@@ -95,10 +94,6 @@ export type ConfirmationModalProps<isConfig extends boolean = false> = PropsWith
9594
* Configuration object for confirmation behavior.
9695
*/
9796
confirmationConfig?: ConfirmationConfigType
98-
/**
99-
* If provided, the modal will use the specified theme instead of using the theme set by theme provider.
100-
*/
101-
overriddenTheme?: AppThemeType
10297
/**
10398
* @default false
10499
* @deprecated Used to extend the width to 500px and remove gap between title and subTitle.

src/Shared/Providers/ThemeProvider/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
export const THEME_PREFERENCE_STORAGE_KEY = 'themePreference'
17+
export const THEME_PREFERENCE_STORAGE_KEY = 'themePreference__v1'
1818

1919
export const DARK_COLOR_SCHEME_MATCH_QUERY = '(prefers-color-scheme: dark)'

src/Shared/Providers/ThemeProvider/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
export * from './ThemeProvider'
1818
export { AppThemeType } from './types'
19-
export { getComponentSpecificThemeClass, getAppThemeForAutoPreference, getThemePreferenceText } from './utils'
19+
export { getComponentSpecificThemeClass, getThemePreferenceText } from './utils'

0 commit comments

Comments
 (0)