@fortawesome/free-solid-svg-icons#faFolder JavaScript Examples

The following examples show how to use @fortawesome/free-solid-svg-icons#faFolder. 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: Sidebar.js    From Postman-Clone with MIT License 5 votes vote down vote up
Sidebar = () => {
  const [tabs] = useState(["History", "Collections", "APIs"]);
  const [tabIndex, setTabIndex] = useState(1);

  const handleTabChange = (index) => {
    setTabIndex(index);
  };

  return (
    <div className="sidebar">
      <div className="sidebar__searchBarWrapper">
        <input
          type="text"
          placeholder="Filter"
          className="sidebar__searchBar"
        />
        <div className="sidebar__menu">
          {tabs.map((tab, index) => {
            return (
              <span
                onClick={() => handleTabChange(index)}
                className={
                  index === tabIndex
                    ? "sidebar__menuOptions active"
                    : "sidebar__menuOptions"
                }
              >
                {tab}
              </span>
            );
          })}
        </div>
        <div className="sidebar__row">
          <div className="sidebar__column">
            <span className="sidebar__newCollectionLink">
              <FontAwesomeIcon icon={faPlus} /> New Collection
            </span>
            <span className="sidebar__trashLink">Trash</span>
          </div>
        </div>
        {/* Collections List */}
        <div className="sidebar__collectionList">
          {collections.map((collection, index) => {
            return (
              <div className="sidebar__collection">
                <div className="sidebar__collectionRow">
                  <div className="sidebar__collectionColumn">
                    <FontAwesomeIcon
                      icon={faCaretRight}
                      className="sidebar__icons"
                    />
                    <FontAwesomeIcon
                      icon={faFolder}
                      className="sidebar__icons"
                    />
                  </div>
                  <div className="sidebar__collectionColumn">
                    <span>{collection.name}</span>
                    <p className="sidebar__collectionRequests">
                      {collection.requestsCount} Requests
                    </p>
                  </div>
                </div>
              </div>
            );
          })}
        </div>
      </div>
    </div>
  );
}