Add useEffect
This commit is contained in:
parent
210716a83b
commit
829f7d15d7
|
@ -18,8 +18,6 @@ type Story = StoryObj<typeof meta>
|
|||
|
||||
export const Default: Story = {
|
||||
args: {
|
||||
valueOf: () => {
|
||||
return true
|
||||
},
|
||||
isVisibleState: true,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue