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

The following examples show how to use @fortawesome/free-solid-svg-icons#faShapes. 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: index.tsx    From excalideck with MIT License 6 votes vote down vote up
export default function SelectedSlideControl({
    slide,
    onDelete,
    onUpdateShouldRender,
    onUpdateShouldRenderWithCommonExcalidrawElements,
}: Props) {
    return (
        <div className="SelectedSlideControl">
            <div>
                <IconCheckbox
                    title="Skip"
                    checked={slide.shouldRender}
                    onChange={onUpdateShouldRender}
                    checkedIcon={faEye}
                    uncheckedIcon={faEyeSlash}
                />
                <IconCheckbox
                    title="Include common elements"
                    checked={slide.shouldRenderWithCommonExcalidrawElements}
                    onChange={onUpdateShouldRenderWithCommonExcalidrawElements}
                    checkedIcon={faShapes}
                    uncheckedIcon={faCircle}
                />
            </div>
            <div>
                <IconButton
                    title="Delete slide"
                    icon={faTrashAlt}
                    onClick={() =>
                        window.confirm("Delete the selected slide?") &&
                        onDelete()
                    }
                />
            </div>
        </div>
    );
}
Example #2
Source File: AddButton.tsx    From ble with Apache License 2.0 5 votes vote down vote up
AddButton: FunctionComponent<Props> = ({ selected }) => {
	const [showDropdown, setShowDropdown] = useState(selected);
	const { editor } = useStore();

	useEffect(() => {
		setShowDropdown(selected);
	}, [selected]);

	function setBlockType(ev: ChangeEvent<HTMLInputElement>): void {
		if (!Object.values(AddType).some((allowedType) => allowedType === ev.target.value)) {
			throw new TypeError('Incorrect entity type');
		}
		const addType: AddType = ev.target.value as AddType;

		setShowDropdown(false);
		editor.setAddType(addType);
	}

	function toggleDropdown(): void {
		setShowDropdown(!showDropdown);
	}

	return (
		<Fragment>
			<FontAwesomeIcon icon={faShapes} onClick={toggleDropdown}/>
			{showDropdown && (
				<ButtonContainer>
					{[miscAddTypes, blockAddTypes, ballAddTypes].map((addTypes, i) => (
						<AddTypeCategory key={i}>
							{addTypes.map((type: AddType) => (
								<Label key={type}>
									<input
										type="radio"
										onChange={setBlockType}
										checked={type === editor.addType}
										value={type}
									/>
									{addTypeAliases[type]}
								</Label>
							))}
						</AddTypeCategory>
					))}
				</ButtonContainer>
			)}
		</Fragment>
	);
}