@fortawesome/free-solid-svg-icons#faDroplet TypeScript Examples

The following examples show how to use @fortawesome/free-solid-svg-icons#faDroplet. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OpacityParam.tsx    From ble with Apache License 2.0 5 votes vote down vote up
ZOrderParam: FunctionComponent<Props> = ({ params }) => {
	const { undoManager } = useStore();

	const onChange = (newOpacity: number): void => {
		params.setOpacity(newOpacity);
	};

	function onFocus(): void {
		undoManager.startGroup();
	}
	function onBlur(): void {
		undoManager.stopGroup();
	}

	const min = 0;
	const max = 1;
	const step = 0.01;


	return (
		<Container>
			<label>
				<FontAwesomeIcon icon={faDroplet}/>
				&#32;
				opacity:
				&#32;
				<OpacityInput
					value={params.opacity}
					min={min}
					max={max}
					step={step}
					onChange={onChange}
					onFocus={onFocus}
					onBlur={onBlur}
				/>
			</label>
			<input
				type="range"
				min={min}
				max={max}
				step={step}
				value={params.opacity}
				onChange={(ev: ChangeEvent<HTMLInputElement>) => onChange(ev.target.valueAsNumber)}
				onFocus={onFocus}
				onBlur={onBlur}
			/>
		</Container>
	);
}