Skip to content

Commit

Permalink
feat(BottomSheet): Forward ref in BottomSheetItem
Browse files Browse the repository at this point in the history
  • Loading branch information
zatteo committed Jan 10, 2023
1 parent 92bdcb8 commit 2e9ab47
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions react/BottomSheet/BottomSheetItem.jsx
@@ -1,27 +1,29 @@
import React from 'react'
import React, { forwardRef } from 'react'
import PropTypes from 'prop-types'
import cx from 'classnames'

import Paper from 'cozy-ui/transpiled/react/Paper'

const BottomSheetItem = ({
children,
disableGutters,
disableElevation,
className,
...props
}) => {
return (
<Paper
elevation={disableElevation ? 0 : 0} // need to set correct shadow values before setting a real elevation value
square
className={cx({ 'u-p-1': !disableGutters }, className)}
{...props}
>
{children}
</Paper>
)
}
const BottomSheetItem = forwardRef(
(
{ children, disableGutters, disableElevation, className, ...props },
ref
) => {
return (
<Paper
ref={ref}
elevation={disableElevation ? 0 : 0} // need to set correct shadow values before setting a real elevation value
square
className={cx({ 'u-p-1': !disableGutters }, className)}
{...props}
>
{children}
</Paper>
)
}
)

BottomSheetItem.displayName = 'BottomSheetItem'

BottomSheetItem.propTypes = {
/** CSS classes */
Expand Down

0 comments on commit 2e9ab47

Please sign in to comment.