Add useEffect

This commit is contained in:
Hristo Nedelkov 2023-09-05 10:22:19 +03:00
parent 210716a83b
commit 829f7d15d7
2 changed files with 8 additions and 5 deletions

View File

@ -18,8 +18,6 @@ type Story = StoryObj<typeof meta>
export const Default: Story = {
args: {
valueOf: () => {
return true
},
isVisibleState: true,
},
}

View File

@ -1,12 +1,17 @@
import { useState } from 'react'
import { useEffect, useState } from 'react'
import { XStack, YStack } from 'tamagui'
import { ClearIcon } from '@status-im/icons'
import { Avatar, Text } from '@status-im/components'
type PairedDeviceCardProps = {
isVisibleState: boolean
}
const PairedDeviceCard = (isVisibleState: PairedDeviceCardProps) => {
const [isVisible, setIsVisible] = useState(isVisibleState)
const [isVisible, setIsVisible] = useState(true)
useEffect(() => {
setIsVisible(isVisibleState.isVisibleState)
}, [isVisibleState])
if (!isVisible) return null