Skip to content

Commit

Permalink
chore(deps): update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 14, 2021
1 parent f79fe20 commit 0771e19
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
"author": "Kenny Wong <wowohoo@qq.com>",
"license": "MIT",
"dependencies": {
"@uiw/react-github-corners": "1.4.0",
"@uiw/copy-to-clipboard": "1.0.11",
"@uiw/react-github-corners": "1.4.0",
"@uiw/react-color-circle": "0.0.24",
"@uiw/react-color-shade-slider": "0.0.24",
"@uiw/react-color-sketch": "0.0.24",
"@uiw/react-color-wheel": "0.0.24",
"react": "17.0.2",
"@uiw/react-color-circle": "0.0.21",
"@uiw/react-color-sketch": "0.0.21",
"react-dom": "17.0.2",
"prismjs": "1.24.1"
},
Expand Down
23 changes: 19 additions & 4 deletions src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { useMemo, useState } from 'react';
import GitHubCorners from '@uiw/react-github-corners';
import { hsvaToRgba, ColorResult } from '@uiw/color-convert';
import { hsvaToRgba, hsvaToHex, ColorResult } from '@uiw/color-convert';
import Circle, { CircleProps } from '@uiw/react-color-circle';
import Wheel from '@uiw/react-color-wheel';
import ShadeSlider from '@uiw/react-color-shade-slider';
import Sketch from '@uiw/react-color-sketch';
import styles from './App.module.css';
import Code from './Code';
Expand All @@ -22,16 +24,14 @@ function CircleColors(props: CircleProps & { title?: string; index: number }) {

export default function App() {
const [hsva, setHsva] = useState({ h: 209, s: 36, v: 90, a: 1 });
const [hex, setHex] = useState('#E0E0E0');
const handleColorChange = (data: ColorResult) => {
setHsva(data.hsva);
setHex(data.hex);
};
const handleSwatchesPicker = (data: ColorResult) => {
setHsva(data.hsva);
setHex(data.hex);
};
const color = hsvaToRgba(hsva);
const hex = hsvaToHex(hsva);
return (
<div
style={{
Expand All @@ -55,6 +55,21 @@ export default function App() {
</div>
<div className={styles.pane}>
<div>
<Wheel
color={hsva}
onChange={handleColorChange}
style={{
marginBottom: 20,
boxShadow: 'rgb(0 0 0 / 15%) 0px 0px 0px 1px, rgb(0 0 0 / 15%) 0px 8px 16px',
borderRadius: '50%',
}}
/>
<ShadeSlider
hsva={hsva}
radius={8}
style={{ marginBottom: 21, background: 'transparent', backgroundColor: 'transparent' }}
onChange={(newShade) => setHsva({ ...hsva, v: newShade.v })}
/>
<Sketch color={hsva} onChange={handleColorChange} />
<div className={styles.footer}>
<div>Copyright © uiwjs 2021.</div>
Expand Down

0 comments on commit 0771e19

Please sign in to comment.