Skip to content

Commit

Permalink
fix(drawer): expose refs for content/footer
Browse files Browse the repository at this point in the history
  • Loading branch information
mleralec committed Nov 6, 2023
1 parent 2aeaee1 commit acf27e8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 6 additions & 4 deletions packages/Drawer/src/Content.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React from 'react'
import { BoxProps } from '@welcome-ui/box'
import { CreateWuiProps, forwardRef } from '@welcome-ui/system'

import * as S from './styles'

export const Content: React.FC<BoxProps> = props => {
return <S.Content flex="1" overflowY={{ md: 'auto' }} {...props} />
}
type ContentProps = CreateWuiProps<'div'>

export const Content = forwardRef<'div', ContentProps>((props, ref) => {
return <S.Content flex="1" overflowY={{ md: 'auto' }} ref={ref} {...props} />
})
9 changes: 6 additions & 3 deletions packages/Drawer/src/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import React from 'react'
import { BoxProps } from '@welcome-ui/box'
import { CreateWuiProps, forwardRef } from '@welcome-ui/system'

import * as S from './styles'

export const Footer: React.FC<BoxProps> = props => {
type FooterProps = CreateWuiProps<'div'>

export const Footer = forwardRef<'div', FooterProps>((props, ref) => {
return (
<S.Footer
bottom={{ xs: 0, md: 'auto' }}
position={{ xs: 'sticky', md: 'static' }}
ref={ref}
w="100%"
{...props}
/>
)
}
})

0 comments on commit acf27e8

Please sign in to comment.