mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-18 14:26:39 +00:00
Update SwitchComponent.tsx
This commit is contained in:
parent
f3dc2f9ca8
commit
5a56737809
@ -1,24 +1,31 @@
|
|||||||
import { Switch } from "tamagui"
|
import { Switch } from 'tamagui'
|
||||||
|
type SwitchComponentProps = {
|
||||||
|
timestamps: boolean
|
||||||
|
setTimestamps: (timestamps: boolean) => void
|
||||||
|
}
|
||||||
|
|
||||||
const SwitchComponent = () => {
|
const SwitchComponent = ({ timestamps, setTimestamps }: SwitchComponentProps) => {
|
||||||
|
const handleCheckedChange = () => {
|
||||||
|
setTimestamps(!timestamps)
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Switch
|
<Switch
|
||||||
size="$1"
|
size="$1"
|
||||||
style={ { backgroundColor: 'grey'} }
|
style={{ backgroundColor: timestamps ? '#4360df' : 'grey', border: 'none' }}
|
||||||
checked={false}
|
checked={timestamps}
|
||||||
onCheckedChange={() =>(console.log(a))}
|
onCheckedChange={handleCheckedChange}
|
||||||
>
|
>
|
||||||
<Switch.Thumb
|
<Switch.Thumb
|
||||||
style={{
|
style={{
|
||||||
right: 7,
|
right: 7,
|
||||||
bottom: 3,
|
bottom: 3,
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
height: '16px',
|
height: '18px',
|
||||||
width: '16px',
|
width: '18px',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Switch>
|
</Switch>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default SwitchComponent
|
export default SwitchComponent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user