feat(panel-wrapper): flag to fit content height

This commit is contained in:
RadoslavDimchev 2024-05-02 10:16:20 +03:00 committed by Emil Ivanichkov
parent ee0a51621e
commit 0146e154f3
4 changed files with 14 additions and 3 deletions

View File

@ -19,6 +19,7 @@ const DepositPanel = () => {
return (
<PanelWrapper
title={getDepositTitle({ isChainParity, isTransactionConfirmation })}
fitContentHeight={true}
>
{isChainParity ? (
<ChainParity />

View File

@ -9,7 +9,7 @@ const ExitPanel = () => {
const exitValidatorHandler = () => {}
return (
<PanelWrapper title={'Exit Validator'}>
<PanelWrapper title={'Exit Validator'} fitContentHeight={true}>
<YStack alignItems={'flex-start'} marginTop={'6px'}>
<Text size={15} weight="semibold">
Validator Exit Queue

View File

@ -20,7 +20,11 @@ const PanelContent = ({
return (
<YStack
space={'$3'}
style={{ padding: isModalWidth ? 0 : '20px 30px', alignItems: 'start' }}
style={{
padding: isModalWidth ? 0 : '20px 30px',
alignItems: 'start',
overflowY: 'scroll',
}}
>
{isModalWidth && (
<XStack

View File

@ -9,9 +9,14 @@ import PanelContent from './PanelContent'
type PanelWrapperProps = {
children: React.ReactNode
title: string
fitContentHeight?: boolean
}
const PanelWrapper = ({ children, title }: PanelWrapperProps) => {
const PanelWrapper = ({
children,
title,
fitContentHeight,
}: PanelWrapperProps) => {
const [isModalOpen, setIsModalOpen] = useState(true)
const navigate = useNavigate()
const { validatorName } = useParams()
@ -36,6 +41,7 @@ const PanelWrapper = ({ children, title }: PanelWrapperProps) => {
margin: 'auto',
scrollbarWidth: 'thin',
scrollbarColor: 'transparent transparent',
height: fitContentHeight ? 'fit-content' : 'auto',
},
overlay: {
zIndex: 2,