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

The following examples show how to use @fortawesome/free-solid-svg-icons#faCloudDownloadAlt. 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: ItemListedDownloadLink.tsx    From sync-party with GNU General Public License v3.0 6 votes vote down vote up
export default function ItemListedDownloadLink({
    partyId,
    itemId,
    hovering
}: Props): ReactElement {
    const { t } = useTranslation();

    return (
        <a
            className={
                'text-gray-300 hover:text-white' +
                (!hovering ? ' hidden' : ' mr-2 my-auto')
            }
            title={t('mediaMenu.download')}
            href={
                '/api/file/' + itemId + '?party=' + partyId + '&download=true'
            }
            target="_blank"
            rel="noopener noreferrer"
        >
            <FontAwesomeIcon
                icon={faCloudDownloadAlt}
                size="sm"
            ></FontAwesomeIcon>
        </a>
    );
}
Example #2
Source File: FileSwitcher.tsx    From frontend.ro with MIT License 4 votes vote down vote up
render() {
    const {
      readOnly,
      maxHeight,
      folderStructure,
      selectedFileKey,
      feedbacks: feedbacksProp,
    } = this.props;

    const {
      ctxMenuKey,
      isCollapsed,
      ctxMenuType,
      dropdownStyle,
      isGeneratingArchive,
    } = this.state;

    let { renamedAsset } = this.state;
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore
    renamedAsset = renamedAsset || { key: null };

    const files = folderStructure.files.map((f) => ({ ...f, icon: FileIcons.getIcon(f.name) }));
    const feedbacks = new Feedbacks(null, feedbacksProp || []).getTypesByFileKey();

    return (
      <div
        className={`
          ${styles['file-switcher']}
          ${readOnly ? styles['is--read-only'] : ''}
          ${isCollapsed ? styles['is--collapsed'] : ''}`}
        ref={this.fileSwitcherRef}
        style={{ width: `${INITIAL_WIDTH_PX}px`, minWidth: `${MIN_WIDTH_PX}px`, maxHeight: `${maxHeight}px` }}
      >
        {isCollapsed && (
          <Button onClick={this.toggleCollapse} title="Browse files" className={`${styles['toggle-button']}`}>
            <img src={FileIcons.getIconUrl('svg')} alt="File SVG icon" />
          </Button>
        )}
        <div className={styles.controls}>
          <div>
            {!readOnly && (
              <Button onClick={() => this.newFile()} title="New file">
                <FontAwesomeIcon icon={faPlus} width="18" height="18" />
              </Button>
            )}
            {!readOnly && (
              <Button onClick={() => this.newFolder()} title="New folder">
                <FontAwesomeIcon icon={faFolderPlus} width="18" height="18" />
              </Button>
            )}
            <Button
              onClick={this.onDownload}
              loading={isGeneratingArchive}
              title="Download to device"
            >
              <FontAwesomeIcon icon={faCloudDownloadAlt} width="18" height="18" />
            </Button>
          </div>
          <Button onClick={this.toggleCollapse} title="Collapse panel">
            <FontAwesomeIcon icon={faChevronLeft} width="18" height="18" />
          </Button>
        </div>
        {/* <Scroll className="is--fliped-x"> */}
        <div>
          {folderStructure.folders.map((folder, index) => (
            <FolderBrowse
              key={folder.key}
              folderKey={folder.key}
              folderStructure={folderStructure}
              // eslint-disable-next-line @typescript-eslint/ban-ts-comment
              // @ts-ignore
              feedbacks={feedbacks}
              readOnly={readOnly}
              selectFile={this.selectFile}
              selectedFileKey={selectedFileKey}
              renamedAsset={renamedAsset}
              ctxMenuKey={ctxMenuKey}
              openMenu={this.openMenu}
              enterEditMode={this.enterEditMode}
              onRename={this.onRename}
              saveAsset={this.saveAsset}
            />
          ))}
          <FilesList
            readOnly={readOnly}
            files={files}
            feedbacks={feedbacks}
            selectedFileKey={selectedFileKey}
            ctxMenuKey={ctxMenuKey}
            selectFile={this.selectFile}
            enterEditMode={this.enterEditMode}
            openMenu={this.openMenu}
            renamedAsset={renamedAsset}
            onRename={this.onRename}
            saveAsset={this.saveAsset}
          />
        </div>
        {/* </Scroll> */}
        <List className={styles['dropdown-menu']} style={dropdownStyle}>
          {ctxMenuType === 'FOLDER' && (
            <>
              <li>
                <Button onClick={() => this.newFile(ctxMenuKey)}>
                  <FontAwesomeIcon icon={faFileAlt} width="18" height="18" />
                  New file
                </Button>
              </li>
              <li>
                <Button onClick={() => this.newFolder(ctxMenuKey)}>
                  <FontAwesomeIcon icon={faFolder} width="18" height="18" />
                  New folder
                </Button>
              </li>
            </>
          )}
          <li>
            <Button onClick={() => this.enterEditMode(ctxMenuKey)}>
              <FontAwesomeIcon icon={faEdit} width="18" height="18" />
              Rename
            </Button>
          </li>
          <li>
            <Button onClick={() => this.deleteFileOrFolder(ctxMenuKey)}>
              <FontAwesomeIcon icon={faTrashAlt} width="18" height="18" />
              Delete
            </Button>
          </li>
        </List>
        <HResizable onResize={this.onResize} />
      </div>
    );
  }