Skip to content

Commit

Permalink
feat(HTL-110511): Add helper function to get style
Browse files Browse the repository at this point in the history
  • Loading branch information
coolestKev committed Nov 5, 2024
1 parent 3492be3 commit 9b279d8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/core/src/Drawer/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ const dragToDismissAnimation = (onDragEnd) => {
}
}

const getDividerStyle = ({ showDivider, boxShadow }) =>
showDivider
? {
boxShadow,
}
: {}

export const Drawer: React.FC<DrawerProps> = ({
children,
heading,
Expand Down Expand Up @@ -143,13 +150,7 @@ export const Drawer: React.FC<DrawerProps> = ({
overflow='scroll'
onScroll={onScrollHandler}
data-testid='drawer-divider'
style={
showDivider
? {
boxShadow,
}
: {}
}
style={getDividerStyle({ showDivider, boxShadow })}
>
<Box py={2} px={3} height='100%'>
{children}
Expand Down

0 comments on commit 9b279d8

Please sign in to comment.