@fortawesome/free-solid-svg-icons APIs
- faTimes
- faCheck
- faTrash
- faCog
- faInfoCircle
- faPlus
- faSearch
- faSpinner
- faArrowLeft
- faCopy
- faChevronDown
- faExclamationTriangle
- faUser
- faEdit
- faBars
- faHome
- faCheckCircle
- faExclamationCircle
- faQuestionCircle
- faPlay
- faTrashAlt
- faArrowRight
- faChevronRight
- faChevronUp
- fas
- faEye
- faSignOutAlt
- faLink
- faPen
- faSync
- faEyeSlash
- faStar
- faChevronLeft
- faLock
- faDownload
- faCaretDown
- faClock
- IconDefinition
- faEllipsisV
- faHeart
- faCode
- faAngleDown
- faTimesCircle
- faGlobe
- faFilter
- faSave
- faBell
- faList
- faSortDown
- faSortUp
- faUsers
- faArrowDown
- faArrowUp
- faPause
- faUndo
- faMoon
- faWindowMaximize
- faSyncAlt
- faExternalLinkAlt
- faAngleUp
- faAngleLeft
- faUpload
- faClipboard
- faBook
- faComments
- faSquare
- faCheckDouble
- faPlusCircle
- faComment
- faRandom
- faStop
- faFolderPlus
- faCamera
- faBan
- faEnvelope
- faGavel
- faPalette
- faPlane
- faTasks
- faPencilAlt
- faExchangeAlt
- faMapMarkerAlt
- faAngleRight
- faSun
- faMicrophone
- faMicrophoneSlash
- faVideo
- faVideoSlash
- faFile
- faLanguage
- faCogs
- faUserEdit
- faUserPlus
- faMinus
- faFolderOpen
- faCircleNotch
- faUserAlt
- faCodeBranch
- faCube
- faLaptopCode
- faMap
- faChartArea
- faHistory
- faShare
- faCloudDownloadAlt
- faFileUpload
- faCalendarAlt
- faLightbulb
- faPaperPlane
- faPaintBrush
- faExclamation
- faAnchor
- faBomb
- faMusic
- faCompress
- faExpand
- faRegistered
- faWifi
- faDrawPolygon
- faPhone
- faCommentDots
- faVolumeUp
- faCaretUp
- faBug
- faUserCircle
- faWallet
- faFileContract
- faTag
- faSearchPlus
- faSort
- faKey
- faVolumeMute
- faPowerOff
- faBolt
- faRedoAlt
- faSortAmountDown
- faCloudUploadAlt
- faShapes
- faSortAmountUp
- faTools
- faFileCode
- faRedo
- faAlignLeft
- faUserFriends
- faBookOpen
- faChartBar
- faFileExport
- faFileImport
- faSadCry
- faRocket
- faLinkSlash
- faTh
- faLongArrowAltRight
- faTags
- faDog
- faTv
- faCartPlus
- faMicrochip
- faNetworkWired
- faCommentSlash
- faAddressBook
- faCalendar
- faToggleOff
- faToggleOn
- faUserClock
- faHourglass
- faQuestion
- faStamp
- faAddressCard
- faPoo
- faAppleAlt
- faBible
- faBone
- faCar
- faCat
- faChess
- faSkull
- faFeatherAlt
- faFire
- faWindowMinimize
- faReplyAll
- faSignInAlt
- faBold
- faItalic
- faUnderline
- faHeading
- faQuoteRight
- faListOl
- faListUl
- faLevelDownAlt
- faLevelUpAlt
- faUndoAlt
- faPlug
- faBullhorn
- faPlaneDeparture
- faSimCard
- faBrush
- faAngleDoubleDown
- faCoins
- faCompressArrowsAlt
- faDiceD6
- faNewspaper
- faMinimize
- faUpRightFromSquare
- faCubes
- faRetweet
- faHandPeace
- faSpaceShuttle
- faXmark
- faFileAudio
- faStopwatch
- faDragon
- faSortNumericDown
- faSortNumericDownAlt
- faArrowUpRightFromSquare
- faArrowDown19
- faArrowDown91
- faHashtag
- faRepeat
- faLaptop
- faCloud
- faPiggyBank
- faRunning
- faBiking
- faBicycle
- faShareAlt
- faRuler
- faVial
- faUserTimes
- faUserMinus
- faCalendarDay
- faStepBackward
- faStepForward
- faDotCircle
- faUserLock
- faUserCog
- faTrophy
- faShareSquare
- faHandPointRight
- faChartLine
- faUserShield
- faCheckSquare
- faSortAmountDownAlt
- faIdCard
- faUserSlash
- faCalculator
- faEllipsisH
- faRulerCombined
- faSoap
- faMousePointer
- faHandRock
- faDroplet
- faThumbtack
- faReply
- faLayerGroup
- faMask
- faWindowRestore
- faThLarge
- faDesktop
- faInfo
- faHandsHelping
- faKeyboard
- faChartPie
- faColumns
- faTable
- faTachometerAlt
- faClipboardList
- faHammer
- faLockOpen
- faCity
- faChessRook
- faMountain
- faCampground
- faUniversity
- faCrosshairs
- faWrench
- faArrowCircleLeft
- faIdCardAlt
- faCreditCard
- faDollarSign
- faIdBadge
- faSlidersH
- faEuroSign
- faPoundSign
- faSearchDollar
- faPlayCircle
- faStream
- faFilm
- faSmile
- faPhoneAlt
- faArrowsAltV
- faUserAltSlash
- faLongArrowAltLeft
- faHdd
- faUnlink
- faInbox
- faMagic
- faImage
- faCalendarCheck
- faUserCheck
- faFolder
- faThermometerEmpty
- faCut
- faPaste
- faCircle
- faMobile
- faClipboardCheck
- faSortAlphaUp
- faSortAlphaDown
- faRss
- faPaw
Other Related APIs
- react#useState
- react#useContext
- react#useMemo
- react-i18next#useTranslation
- react-i18next#Trans
- @fortawesome/free-solid-svg-icons#faArrowLeft
- @fortawesome/free-solid-svg-icons#faPlay
- @fortawesome/free-solid-svg-icons#faFileUpload
- @fortawesome/free-solid-svg-icons#faSearch
- @fortawesome/free-solid-svg-icons#faGavel
- @fortawesome/free-solid-svg-icons#faSave
- @fortawesome/free-solid-svg-icons#faFileExport
- @fortawesome/react-fontawesome#FontAwesomeIcon
- @mui/material#Box
- @mui/material#Button
- @mui/material#CardContent
- @mui/material#Typography
- @mui/material#Divider
- @mui/material#Grid
- @mui/material#styled
- @mui/icons-material#Upload
@fortawesome/free-solid-svg-icons#faFileCode TypeScript Examples
The following examples show how to use
@fortawesome/free-solid-svg-icons#faFileCode.
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: components.tsx From MagicUI with Apache License 2.0 | 6 votes |
export function File(props: IFileProps) {
const indent = props.indent || 1;
const active = props.active || false;
const btnStyle = {
textIndent: indent * 10 + 'px'
};
return (
<button className={cls(style.file, active && style.active)} style={btnStyle} onClick={props.onClick}>
<span>
<FontAwesomeIcon icon={faFileCode}/>
</span>
{props.name}
</button>
);
}
Example #2
Source File: UploadCard.tsx From genshin-optimizer with MIT License | 5 votes |
export default function UploadCard() {
const { database } = useContext(DatabaseContext)
const { t } = useTranslation("settings");
const [data, setdata] = useState("")
const [filename, setfilename] = useState("")
const [errorMsg, setErrorMsg] = useState("") // TODO localize error msg
const dataObj: UploadData | undefined = useMemo(() => {
if (!data) return
let parsed: any
try {
parsed = JSON.parse(data)
if (typeof parsed !== "object") {
setErrorMsg("uploadCard.error.jsonParse")
return
}
} catch (e) {
setErrorMsg("uploadCard.error.jsonParse")
return
}
// Figure out the file format
if (parsed.version === "1" && ["flower", "feather", "sand", "cup", "head"].some(k => Object.keys(parsed).includes(k))) {
// Parse as mona format
const imported = importMona(parsed, database)
if (!imported) {
setErrorMsg("uploadCard.error.monaInvalid")
return
}
return imported
} else if (parsed.format === "GOOD") {
// Parse as GOOD format
const imported = importGOOD(parsed, database)
if (!imported) {
setErrorMsg("uploadCard.error.goInvalid")
return
}
return imported
}
setErrorMsg("uploadCard.error.unknown")
return
}, [data, database])
const reset = () => {
setdata("")
setfilename("")
}
const onUpload = async e => {
const file = e.target.files[0]
e.target.value = null // reset the value so the same file can be uploaded again...
if (file) setfilename(file.name)
const reader = new FileReader()
reader.onload = () => setdata(reader.result as string)
reader.readAsText(file)
}
return <CardLight>
<CardContent sx={{ py: 1 }}><Trans t={t} i18nKey="settings:uploadCard.title" /></CardContent>
<CardContent>
<Grid container spacing={2} sx={{ mb: 1 }}>
<Grid item>
<label htmlFor="icon-button-file">
<InvisInput accept=".json" id="icon-button-file" type="file" onChange={onUpload} />
<Button component="span" startIcon={<Upload />}>Upload</Button>
</label>
</Grid>
<Grid item flexGrow={1}>
<CardDark sx={{ px: 2, py: 1 }}>
<Typography>{filename ? <span><FontAwesomeIcon icon={faFileCode} /> {filename}</span> : <span><FontAwesomeIcon icon={faArrowLeft} /> <Trans t={t} i18nKey="settings:uploadCard.hint" /></span>}</Typography>
</CardDark>
</Grid>
</Grid>
<Typography gutterBottom variant="caption"><Trans t={t} i18nKey="settings:uploadCard.hintPaste" /></Typography>
<Box component="textarea" sx={{ width: "100%", fontFamily: "monospace", minHeight: "10em", mb: 2, resize: "vertical" }} value={data} onChange={e => setdata(e.target.value)} />
{UploadInfo(dataObj) ?? errorMsg}
</CardContent>
{UploadAction(dataObj, reset)}
</CardLight>
}
Example #3
Source File: RunTimeTools.tsx From MagicUI with Apache License 2.0 | 5 votes |
export default function RunTimeTools() {
const openFileItems = useSelector((state: IStoreState) => state.openFileItems);
const files = useSelector((state: IStoreState) => state.dslFileArray)
const user = useSelector((state: IStoreState) => state.user);
const handleRun = () => {
Bridge.compile('json', openFileItems.items[openFileItems.currentIndex].code).then(v => {
Bridge.open(WidgetType.WEBGL, v);
})
};
const handleSave = () => {
const cur = openFileItems.items[openFileItems.currentIndex];
saveDslCode(cur.id, user.email, cur.code, cur.fileId).then((v) => {
if (!v.err) {
toast('save code!');
}
})
};
const handleSaveAll = () => {
saveAllDslCode(user.email, files.files).then((v) => {
if (!v.err) {
toast('save all!');
}
});
};
const handleBuild = () => {
Bridge.open(WidgetType.CODE, {
type: 'target',
data: openFileItems.items[openFileItems.currentIndex].code
});
};
return (
<div className={style.run_tools}>
<button className={style.build_btn} onClick={handleBuild}>
<FontAwesomeIcon icon={faGavel}/>
</button>
<button className={style.run_btn} onClick={handleRun}>
<FontAwesomeIcon icon={faPlay}/>
</button>
<button className={style.save_btn} onClick={handleSave}>
<FontAwesomeIcon icon={faFileCode}/>
</button>
<button className={style.save_all_btn} onClick={handleSaveAll}>
<FontAwesomeIcon icon={faSave}/>
</button>
<div className={style.search}>
<input/>
<FontAwesomeIcon icon={faSearch}/>
</div>
</div>
);
}