mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-02-09 10:03:36 +00:00
feat: create separate color picker component
This commit is contained in:
parent
a3b128053a
commit
faad444ed4
33
src/components/General/ColorPicker.tsx
Normal file
33
src/components/General/ColorPicker.tsx
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import { useState } from 'react'
|
||||||
|
import { CirclePicker } from 'react-color'
|
||||||
|
import { XStack } from 'tamagui'
|
||||||
|
|
||||||
|
const ColorPicker = () => {
|
||||||
|
const [chosenColor, setChosenColor] = useState('#FFFFFF')
|
||||||
|
return (
|
||||||
|
<XStack my={10}>
|
||||||
|
<CirclePicker
|
||||||
|
width="80%"
|
||||||
|
circleSize={40}
|
||||||
|
circleSpacing={12}
|
||||||
|
colors={[
|
||||||
|
'#2A4AF5',
|
||||||
|
'#F6B03C',
|
||||||
|
'#7140FD',
|
||||||
|
'#2A799B',
|
||||||
|
'#EC266C',
|
||||||
|
'#1992D7',
|
||||||
|
'#FF7D46',
|
||||||
|
'#216266',
|
||||||
|
'#F66F8F',
|
||||||
|
'#C78F67',
|
||||||
|
'#CB6256',
|
||||||
|
]}
|
||||||
|
color={chosenColor}
|
||||||
|
onChange={color => setChosenColor(color.hex)}
|
||||||
|
/>
|
||||||
|
</XStack>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ColorPicker
|
@ -1,7 +1,6 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { Button as StatusButton, Tag, Text, Avatar, Checkbox } from '@status-im/components'
|
import { Button as StatusButton, Tag, Text, Avatar, Checkbox } from '@status-im/components'
|
||||||
import { Label, Separator, XStack, YStack } from 'tamagui'
|
import { Label, Separator, XStack, YStack } from 'tamagui'
|
||||||
import { CirclePicker } from 'react-color'
|
|
||||||
import PageWrapperShadow from '../../components/PageWrappers/PageWrapperShadow'
|
import PageWrapperShadow from '../../components/PageWrappers/PageWrapperShadow'
|
||||||
import NimbusLogo from '../../components/Logos/NimbusLogo'
|
import NimbusLogo from '../../components/Logos/NimbusLogo'
|
||||||
import Titles from '../../components/General/Titles'
|
import Titles from '../../components/General/Titles'
|
||||||
@ -10,10 +9,10 @@ import PairIcon from '../../components/Icons/PairIcon'
|
|||||||
import CreateIcon from '../../components/Icons/CreateIcon'
|
import CreateIcon from '../../components/Icons/CreateIcon'
|
||||||
import LabelInputField from '../../components/General/LabelInputField'
|
import LabelInputField from '../../components/General/LabelInputField'
|
||||||
import ReactionIcon from '../../components/Icons/ReactionIcon'
|
import ReactionIcon from '../../components/Icons/ReactionIcon'
|
||||||
|
import ColorPicker from '../../components/General/ColorPicker'
|
||||||
|
|
||||||
const CreateLocalNodePage = () => {
|
const CreateLocalNodePage = () => {
|
||||||
const [autoConnectChecked, setAutoConnectChecked] = useState(false)
|
const [autoConnectChecked, setAutoConnectChecked] = useState(false)
|
||||||
const [chosenColor, setChosenColor] = useState('#FFFFFF')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrapperShadow rightImageSrc="/background-images/day-night-bg.png">
|
<PageWrapperShadow rightImageSrc="/background-images/day-night-bg.png">
|
||||||
@ -48,26 +47,7 @@ const CreateLocalNodePage = () => {
|
|||||||
<Text size={13} weight="regular" color={'#647084'}>
|
<Text size={13} weight="regular" color={'#647084'}>
|
||||||
Highlight Color
|
Highlight Color
|
||||||
</Text>
|
</Text>
|
||||||
<CirclePicker
|
<ColorPicker />
|
||||||
width="80%"
|
|
||||||
circleSize={40}
|
|
||||||
circleSpacing={12}
|
|
||||||
colors={[
|
|
||||||
'#2A4AF5',
|
|
||||||
'#F6B03C',
|
|
||||||
'#7140FD',
|
|
||||||
'#2A799B',
|
|
||||||
'#EC266C',
|
|
||||||
'#1992D7',
|
|
||||||
'#FF7D46',
|
|
||||||
'#216266',
|
|
||||||
'#F66F8F',
|
|
||||||
'#C78F67',
|
|
||||||
'#CB6256',
|
|
||||||
]}
|
|
||||||
color={chosenColor}
|
|
||||||
onChange={color => setChosenColor(color.hex)}
|
|
||||||
/>
|
|
||||||
</YStack>
|
</YStack>
|
||||||
</XStack>
|
</XStack>
|
||||||
</YStack>
|
</YStack>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user