@fortawesome/free-brands-svg-icons#faCss3Alt JavaScript Examples
The following examples show how to use
@fortawesome/free-brands-svg-icons#faCss3Alt.
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: Editor.js From Codera with MIT License | 5 votes |
function Editor(props) {
const { displayName, language, value, onChange } = props;
let imgName = "";
if (displayName === "HTML") {
imgName = faHtml5;
}
if (displayName === "CSS") {
imgName = faCss3Alt;
}
if (displayName === "JS") {
imgName = faJs;
}
const [open, setOpen] = useState(true);
function handleChange(editor, data, value) {
onChange(value);
}
return (
<div className={`editor-container ${open ? "expand" : "collapsed"}`}>
<div className="editor-title">
<span>
<FontAwesomeIcon icon={imgName} />
</span>
{displayName}
<button
type="button"
className="expand-collapse-btn"
onClick={() => setOpen((prevOpen) => !prevOpen)}
title={open ? "Collapse" : "Expand"}
>
<FontAwesomeIcon icon={open ? faCompressAlt : faExpandAlt} />
</button>
</div>
<ControlledEditor
onBeforeChange={handleChange}
value={value}
className="code-mirror-wrapper"
options={{
lineWrapping: true,
lint: true,
mode: language,
lineNumbers: true,
theme: "material",
}}
/>
</div>
);
}