Scaffold out UI components

This commit is contained in:
rektdeckard
2020-07-21 23:07:36 -04:00
parent 016e6d987b
commit 19d9b8c7d2
24 changed files with 1063 additions and 528 deletions

View File

@@ -0,0 +1,38 @@
import React from "react";
import { useRecoilState } from "recoil";
import { iconSizeAtom } from "../../state/atoms";
import "./SizeInput.css";
type SizeInputProps = {};
const SizeInput: React.FC<SizeInputProps> = () => {
const [size, setSize] = useRecoilState(iconSizeAtom);
const handleSizeChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const {
target: { value },
} = event;
const sizeInput = parseInt(value);
if (sizeInput > 0) setSize(sizeInput);
};
return (
<div className="size-bar">
<label htmlFor="size-input">{`Size: ${size}px`}</label>
<input
id="size-input"
value={size}
type="range"
title={size.toString()}
min={16}
max={96}
onChange={handleSizeChange}
step={4}
/>
</div>
);
};
export default SizeInput;