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 (
|
||||
<Switch
|
||||
size="$1"
|
||||
style={ { backgroundColor: 'grey'} }
|
||||
checked={false}
|
||||
onCheckedChange={() =>(console.log(a))}
|
||||
style={{ backgroundColor: timestamps ? '#4360df' : 'grey', border: 'none' }}
|
||||
checked={timestamps}
|
||||
onCheckedChange={handleCheckedChange}
|
||||
>
|
||||
<Switch.Thumb
|
||||
style={{
|
||||
right: 7,
|
||||
bottom: 3,
|
||||
backgroundColor: '#fff',
|
||||
height: '16px',
|
||||
width: '16px',
|
||||
height: '18px',
|
||||
width: '18px',
|
||||
}}
|
||||
/>
|
||||
</Switch>
|
||||
)
|
||||
}
|
||||
|
||||
export default SwitchComponent
|
||||
export default SwitchComponent
|
||||
|
Loading…
x
Reference in New Issue
Block a user