react-icons/fi#FiFolderPlus JavaScript Examples

The following examples show how to use react-icons/fi#FiFolderPlus. 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: Filebtn.js    From SauceKudasai with MIT License 6 votes vote down vote up
Filebtn = ({ open, toggleurl, key1, key2 }) => {
	return (
		<>
			<Button onClick={open} key={key1} aria-label="Fileupload button">
				<IconContext.Provider value={{ size: '1.1rem', color: '#303133' }}>
					<FiFolderPlus />
				</IconContext.Provider>
			</Button>
			<Button onClick={toggleurl} key={key2} aria-label="Url button">
				<IconContext.Provider value={{ size: '1.1rem', color: '#303133' }}>
					<FiLink2 />
				</IconContext.Provider>
			</Button>
		</>
	);
}
Example #2
Source File: FolderTools.js    From sailplane-web with GNU General Public License v3.0 4 votes vote down vote up
export function FolderTools({
  currentDirectory,
  sharedFs,
  setCurrentDirectory,
  handleOpenUpload,
  isEncrypted,
}) {
  const [addFolderMode, setAddFolderMode] = useState(false);
  const dispatch = useDispatch();
  const pathSplit = currentDirectory.split('/');
  const folderName = pathSplit[pathSplit.length - 1];
  const isSmallScreen = useIsSmallScreen();
  const hasWrite = doesUserHaveWriteInInstance(sharedFs.current);

  const createFolder = async (newFolderName) => {
    try {
      await sharedFs.current.mkdir(currentDirectory, newFolderName);
      setAddFolderMode(false);
    } catch (e) {
      console.log('Mkdir error', e);
      // Todo: handle error
    }
  };

  const InputComponent = useTextInput(
    addFolderMode,
    (newFolderName) => createFolder(newFolderName),
    () => setAddFolderMode(false),
    '',
    {
      placeholder: 'folder name',
    },
  );

  return (
    <div>
      <div style={styles.tools}>
        <div style={styles.leftTools}>
          {isSmallScreen && addFolderMode ? null : (
            <Breadcrumb
              currentDirectory={currentDirectory}
              setCurrentDirectory={setCurrentDirectory}
            />
          )}
        </div>
        <div style={styles.rightTools}>
          {!addFolderMode ? (
            <>
              {currentDirectory !== '/r' ? (
                <ToolItem
                  id={'folderShare'}
                  disabled={isEncrypted}
                  iconComponent={FiShare2}
                  size={18}
                  changeColor={isEncrypted ? '#DDD' : primary4}
                  onClick={() => {
                    dispatch(
                      setShareData({
                        name: folderName,
                        path: currentDirectory,
                        pathType: 'dir',
                      }),
                    );
                  }}
                />
              ) : null}
              <ToolItem
                iconComponent={FiUpload}
                size={18}
                changeColor={primary4}
                onClick={() => {
                  handleOpenUpload();
                }}
              />
              {hasWrite ? (
                <ToolItem
                  id={'addFolder'}
                  iconComponent={FiFolderPlus}
                  size={18}
                  changeColor={primary4}
                  onClick={() => setAddFolderMode(true)}
                />
              ) : null}
            </>
          ) : null}

          {addFolderMode ? <>{InputComponent}</> : null}
        </div>
      </div>
    </div>
  );
}