From 3cabfc3019d0f7fbc71f6831ef231a2d4788ecf5 Mon Sep 17 00:00:00 2001 From: Marcos Moura Date: Mon, 25 Sep 2023 11:57:57 +0300 Subject: [PATCH] fix: convert object into function --- .../DrawerInline/useDrawerInlineStyles.styles.ts | 8 ++------ .../DrawerOverlay/useDrawerOverlayStyles.styles.ts | 4 ++-- .../react-drawer/src/shared/useDrawerBaseStyles.styles.ts | 4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/react-components/react-drawer/src/components/DrawerInline/useDrawerInlineStyles.styles.ts b/packages/react-components/react-drawer/src/components/DrawerInline/useDrawerInlineStyles.styles.ts index 46475db2cf1a85..bc43ee0bfee311 100644 --- a/packages/react-components/react-drawer/src/components/DrawerInline/useDrawerInlineStyles.styles.ts +++ b/packages/react-components/react-drawer/src/components/DrawerInline/useDrawerInlineStyles.styles.ts @@ -4,18 +4,14 @@ import type { SlotClassNames } from '@fluentui/react-utilities'; import { tokens } from '@fluentui/react-theme'; import type { DrawerInlineSlots, DrawerInlineState } from './DrawerInline.types'; -import { - drawerCSSVars, - getDrawerDefaultStyles, - useDrawerBaseClassNames, -} from '../../shared/useDrawerBaseStyles.styles'; +import { drawerCSSVars, drawerDefaultStyles, useDrawerBaseClassNames } from '../../shared/useDrawerBaseStyles.styles'; export const drawerInlineClassNames: SlotClassNames = { root: 'fui-DrawerInline', }; const useDrawerResetStyles = makeResetStyles({ - ...getDrawerDefaultStyles(), + ...drawerDefaultStyles, position: 'relative', opacity: 0, transitionProperty: 'opacity, transform', diff --git a/packages/react-components/react-drawer/src/components/DrawerOverlay/useDrawerOverlayStyles.styles.ts b/packages/react-components/react-drawer/src/components/DrawerOverlay/useDrawerOverlayStyles.styles.ts index 9586609f288ce4..35e7430cb5958f 100644 --- a/packages/react-components/react-drawer/src/components/DrawerOverlay/useDrawerOverlayStyles.styles.ts +++ b/packages/react-components/react-drawer/src/components/DrawerOverlay/useDrawerOverlayStyles.styles.ts @@ -6,7 +6,7 @@ import type { SlotClassNames } from '@fluentui/react-utilities'; import type { DrawerOverlaySlots, DrawerOverlayState } from './DrawerOverlay.types'; import { drawerCSSVars, - getDrawerDefaultStyles, + drawerDefaultStyles, useDrawerBaseClassNames, useDrawerDurationStyles, } from '../../shared/useDrawerBaseStyles.styles'; @@ -21,7 +21,7 @@ export const drawerOverlayClassNames: Omit, ' */ const useDrawerRootStyles = makeStyles({ root: { - ...getDrawerDefaultStyles(), + ...drawerDefaultStyles, position: 'fixed', top: 0, bottom: 0, diff --git a/packages/react-components/react-drawer/src/shared/useDrawerBaseStyles.styles.ts b/packages/react-components/react-drawer/src/shared/useDrawerBaseStyles.styles.ts index 8feb8a309ab84f..85e96d626dcbc8 100644 --- a/packages/react-components/react-drawer/src/shared/useDrawerBaseStyles.styles.ts +++ b/packages/react-components/react-drawer/src/shared/useDrawerBaseStyles.styles.ts @@ -13,7 +13,7 @@ export const drawerCSSVars = { /** * Default shared styles for the Drawer component */ -export const getDrawerDefaultStyles = (): GriffelStyle => ({ +export const drawerDefaultStyles: GriffelStyle = { ...shorthands.padding(0), ...shorthands.overflow('hidden'), ...shorthands.borderRadius(0), @@ -28,7 +28,7 @@ export const getDrawerDefaultStyles = (): GriffelStyle => ({ alignItems: 'flex-start', justifyContent: 'flex-start', backgroundColor: tokens.colorNeutralBackground1, -}); +}; /** * Shared dynamic styles for the Drawer component