feat(panel-image): create separate component

This commit is contained in:
RadoslavDimchev 2024-04-16 12:41:53 +03:00 committed by Radoslav Dimchev
parent 18fbcd35df
commit 479750829b
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
import { Text } from '@status-im/components'
import { YStack } from 'tamagui'
import { useWindowSize } from '../../../hooks/useWindowSize'
import { MODAL_WIDTH } from '../../../constants'
type PanelImageProps = {
imagePath: string
text: string
}
const PanelImage = ({ imagePath, text }: PanelImageProps) => {
const { width } = useWindowSize()
const isModalWidth = width < MODAL_WIDTH
return (
<YStack
space={'$3'}
style={{
alignItems: 'center',
textAlign: 'center',
marginBottom: '6px',
}}
>
<img
src={`/images/${imagePath}`}
alt={imagePath}
style={{ width: isModalWidth ? '200px' : '300px' }}
/>
<div style={{ width: '73%' }}>
<Text size={15}>{text}</Text>
</div>
</YStack>
)
}
export default PanelImage