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

The following examples show how to use @fortawesome/free-solid-svg-icons#faLanguage. 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: LandingPage.tsx    From longwave with MIT License 6 votes vote down vote up
function LanguageMenu() {
  return (
    <Tooltip
      interactive
      position="bottom"
      sticky
      tabIndex={0}
      html={<Languages />}
    >
      <FontAwesomeIcon size="lg" icon={faLanguage} />
    </Tooltip>
  );
}
Example #2
Source File: shared.module.ts    From enterprise-ng-2020-workshop with MIT License 6 votes vote down vote up
constructor(faIconLibrary: FaIconLibrary) {
    faIconLibrary.addIcons(
      faGithub,
      faMediumM,
      faPlus,
      faEdit,
      faTrash,
      faTimes,
      faCaretUp,
      faCaretDown,
      faExclamationTriangle,
      faFilter,
      faTasks,
      faCheck,
      faSquare,
      faLanguage,
      faPaintBrush,
      faLightbulb,
      faWindowMaximize,
      faStream,
      faBook
    );
  }
Example #3
Source File: TextParam.tsx    From ble with Apache License 2.0 4 votes vote down vote up
ParamsBox: FunctionComponent<Props> = ({ params }) => {
	const selectRef = useRef(null);
	const { undoManager } = useStore();

	const onChangeText = (ev: ChangeEvent<HTMLTextAreaElement>, code: string): void => {
		params.setCopy(code, ev.target.value);
	};

	function onTextFocus(): void {
		undoManager.startGroup();
	}
	function onTextBlur(): void {
		undoManager.stopGroup();
	}

	const onAddLanguage = (): void => {
		if (selectRef.current === null) return;

		// why is typescript being dumb?
		// @ts-expect-error
		params.setCopy(selectRef.current.value, '');
	};

	const onRemoveLanguage = (code: string): void => {
		if (selectRef.current === null) return;

		params.removeLang(code);
	};

	const unusedLanguages = Object.entries(params.copy)
		.filter(([, copy]) => copy === undefined)
		.map(([code]) => code);

	const onChangeAlign = (ev: ChangeEvent<HTMLSelectElement>): void => {
		params.setAlign(ev.target.value as Align);
	};

	return (
		<Fragment>
			<LanguageList>
				{Object.entries(params.copy)
					.filter(([, copy]) => copy !== undefined)
					.map(([code, copy]) => (
						<LanguageRow key={code}>
							<div>
								<LangLabel htmlFor={`text-param-${code}`}>{languages.getNativeName(code)}:</LangLabel>
								{code !== 'en' && (
									<DangerButton
										onClick={(): void => onRemoveLanguage(code)}
										title="Remove language"
									>
										<FontAwesomeIcon icon={faTrashAlt}/>
									</DangerButton>
								)}
							</div>
							<textarea
								id={`text-param-${code}`}
								rows={3}
								cols={40}
								wrap="off"
								value={copy}
								onChange={(ev): void => onChangeText(ev, code)}
								onFocus={onTextFocus}
								onBlur={onTextBlur}
								minLength={1}
							/>
						</LanguageRow>
					))}
			</LanguageList>
			<div>
				<select ref={selectRef} defaultValue="es">
					{unusedLanguages.map((code) => (
						<option key={code} value={code}>{languages.getNativeName(code)}</option>
					))}
				</select>
				<button onClick={onAddLanguage}>
					<FontAwesomeIcon icon={faLanguage}/>
					&#32;
					Add language
				</button>
			</div>
			<label>
				<FontAwesomeIcon icon={faAlignLeft}/>
				&#32;
				align:
				&#32;
				<select value={params.align} onChange={onChangeAlign}>
					{Object.values(Align).map((align) => (
						<option key={align} value={align}>{align}</option>
					))}
				</select>
			</label>
		</Fragment>
	);
}