-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
716efe0
commit 6414e80
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
apps/laboratory/src/components/Theming/BorderRadiusInput.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { | ||
Heading, | ||
Slider, | ||
SliderFilledTrack, | ||
SliderMark, | ||
SliderThumb, | ||
SliderTrack | ||
} from '@chakra-ui/react' | ||
|
||
import { ThemeStore } from '../../utils/StoreUtil' | ||
import { useProxy } from 'valtio/utils' | ||
|
||
export default function BorderRadiusInput() { | ||
const state = useProxy(ThemeStore.state) | ||
|
||
return ( | ||
<> | ||
<Heading size="sm" fontWeight="400" as="h2"> | ||
Border Radius | ||
</Heading> | ||
<Slider | ||
min={0} | ||
max={10} | ||
value={parseInt(state.borderRadius.replace('px', ''), 10)} | ||
onChange={val => { | ||
ThemeStore.setBorderRadius(`${val}px`) | ||
}} | ||
> | ||
<SliderMark | ||
value={parseInt(state.borderRadius.replace('px', ''), 10)} | ||
textAlign="center" | ||
bg="blackAlpha.700" | ||
color="white" | ||
mt="3" | ||
ml="-5" | ||
borderRadius="base" | ||
w="12" | ||
> | ||
{state.borderRadius} | ||
</SliderMark> | ||
<SliderTrack> | ||
<SliderFilledTrack /> | ||
</SliderTrack> | ||
<SliderThumb /> | ||
</Slider> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters