parent
0f40ffe604
commit
d9685250b6
4 changed files with 36 additions and 45 deletions
@ -1,28 +1,26 @@ |
||||
import { FC } from 'react'; |
||||
import { Box as MUIBox, BoxProps as MUIBoxProps } from '@mui/material'; |
||||
import { FC, useMemo } from 'react'; |
||||
import { Box as MUIBox, SxProps, Theme } from '@mui/material'; |
||||
|
||||
import { BORDER_RADIUS, DIVIDER } from '../../lib/consts/DEFAULT_THEME'; |
||||
|
||||
type InnerPanelProps = MUIBoxProps; |
||||
const InnerPanel: FC<InnerPanelProps> = ({ sx, ...muiBoxRestProps }) => { |
||||
const combinedSx = useMemo<SxProps<Theme>>( |
||||
() => ({ |
||||
borderWidth: '1px', |
||||
borderRadius: BORDER_RADIUS, |
||||
borderStyle: 'solid', |
||||
borderColor: DIVIDER, |
||||
marginTop: '1.4em', |
||||
marginBottom: '1.4em', |
||||
paddingBottom: 0, |
||||
position: 'relative', |
||||
|
||||
const InnerPanel: FC<InnerPanelProps> = ({ sx, ...muiBoxRestProps }) => ( |
||||
<MUIBox |
||||
{...{ |
||||
sx: { |
||||
borderWidth: '1px', |
||||
borderRadius: BORDER_RADIUS, |
||||
borderStyle: 'solid', |
||||
borderColor: DIVIDER, |
||||
marginTop: '1.4em', |
||||
marginBottom: '1.4em', |
||||
paddingBottom: 0, |
||||
position: 'relative', |
||||
...sx, |
||||
}), |
||||
[sx], |
||||
); |
||||
|
||||
...sx, |
||||
}, |
||||
...muiBoxRestProps, |
||||
}} |
||||
/> |
||||
); |
||||
return <MUIBox {...muiBoxRestProps} sx={combinedSx} />; |
||||
}; |
||||
|
||||
export default InnerPanel; |
||||
|
@ -0,0 +1,10 @@ |
||||
type ExpandablePanelOptionalProps = { |
||||
expandInitially?: boolean; |
||||
loading?: boolean; |
||||
panelProps?: InnerPanelProps; |
||||
showHeaderSpinner?: boolean; |
||||
}; |
||||
|
||||
type ExpandablePanelProps = ExpandablePanelOptionalProps & { |
||||
header: import('react').ReactNode; |
||||
}; |
@ -0,0 +1 @@ |
||||
type InnerPanelProps = import('@mui/material').BoxProps; |
Loading…
Reference in new issue