chore: Add React ColorPicker component and update dependencies
This commit is contained in:
parent
8527370cae
commit
5928920e46
@ -22,6 +22,7 @@
|
||||
"next": "14.2.3",
|
||||
"next-international": "^1.2.4",
|
||||
"react": "^18",
|
||||
"react-colorful": "^5.6.1",
|
||||
"react-datepicker": "^7.3.0",
|
||||
"react-dom": "^18",
|
||||
"react-responsive-modal": "^6.4.2",
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { Button, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from '@nextui-org/react'
|
||||
import ColorPicker from './common/color-picker/ColorPicker'
|
||||
|
||||
import { useAxios } from '@/hooks/useAxios'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
@ -15,6 +17,8 @@ export default function Playground() {
|
||||
const testVar = process.env.NEXT_PUBLIC_TEST
|
||||
const { getMessage } = useMessage()
|
||||
|
||||
const [color, setColor] = useState('#ff0000')
|
||||
|
||||
const handleUsers = async () => {
|
||||
// const users = await get('/api/user/find-all')
|
||||
const params = {
|
||||
@ -61,6 +65,10 @@ export default function Playground() {
|
||||
<p className="text-white">Sass 테스트입니다.</p>
|
||||
</div>
|
||||
<div>{getMessage('hi')}</div>
|
||||
<div>
|
||||
<h1>React ColorPicker</h1>
|
||||
<ColorPicker color={color} setColor={setColor} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
||||
11
src/components/common/color-picker/ColorPicker.jsx
Normal file
11
src/components/common/color-picker/ColorPicker.jsx
Normal file
@ -0,0 +1,11 @@
|
||||
import { HexColorPicker } from 'react-colorful'
|
||||
|
||||
export default function ColorPicker(props) {
|
||||
const { color, setColor } = props
|
||||
|
||||
return (
|
||||
<>
|
||||
<HexColorPicker color={color} onChange={setColor} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@ -5470,6 +5470,11 @@ rbush@^3.0.1:
|
||||
dependencies:
|
||||
quickselect "^2.0.0"
|
||||
|
||||
react-colorful@^5.6.1:
|
||||
version "5.6.1"
|
||||
resolved "https://registry.yarnpkg.com/react-colorful/-/react-colorful-5.6.1.tgz#7dc2aed2d7c72fac89694e834d179e32f3da563b"
|
||||
integrity sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw==
|
||||
|
||||
react-datepicker@^7.3.0:
|
||||
version "7.3.0"
|
||||
resolved "https://registry.npmjs.org/react-datepicker/-/react-datepicker-7.3.0.tgz"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user