feat(panel-content): hide icon for removing modal
This commit is contained in:
parent
69d86c31d5
commit
7b90e3782e
|
@ -5,21 +5,29 @@ import { XStack, YStack } from 'tamagui'
|
|||
type PanelContentProps = {
|
||||
children: React.ReactNode
|
||||
title: string
|
||||
closeModal: () => void
|
||||
closeModal?: () => void
|
||||
isModalWidth?: boolean
|
||||
}
|
||||
|
||||
const PanelContent = ({ children, title, closeModal }: PanelContentProps) => {
|
||||
const PanelContent = ({
|
||||
children,
|
||||
title,
|
||||
closeModal,
|
||||
isModalWidth,
|
||||
}: PanelContentProps) => {
|
||||
return (
|
||||
<YStack space={'$3'} style={{ padding: '30px', alignItems: 'start' }}>
|
||||
<XStack style={{ width: '100%', justifyContent: 'space-between' }}>
|
||||
<Text size={19} weight={'semibold'}>
|
||||
{title}
|
||||
</Text>
|
||||
<ExpandRsIcon
|
||||
size={20}
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={closeModal}
|
||||
/>
|
||||
{isModalWidth && (
|
||||
<ExpandRsIcon
|
||||
size={20}
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={closeModal}
|
||||
/>
|
||||
)}
|
||||
</XStack>
|
||||
{children}
|
||||
</YStack>
|
||||
|
|
|
@ -42,16 +42,16 @@ const PanelWrapper = ({ children, title }: PanelWrapperProps) => {
|
|||
},
|
||||
}}
|
||||
>
|
||||
<PanelContent title={title} closeModal={closeModal}>
|
||||
<PanelContent
|
||||
title={title}
|
||||
closeModal={closeModal}
|
||||
isModalWidth={isModalWidth}
|
||||
>
|
||||
{children}
|
||||
</PanelContent>
|
||||
</Modal>
|
||||
) : (
|
||||
<div>
|
||||
<PanelContent title={title} closeModal={closeModal}>
|
||||
{children}
|
||||
</PanelContent>
|
||||
</div>
|
||||
<PanelContent title={title}>{children}</PanelContent>
|
||||
)}
|
||||
</>
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue