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

The following examples show how to use @fortawesome/free-solid-svg-icons#faCubes. 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: button-icon.js    From ofbiz-ui with Apache License 2.0 6 votes vote down vote up
iconController() {
    switch (this.elemName) {
    case 'project':
      this.faIcon = faCalendarAlt;
      break;
    case 'crm':
      this.faIcon = faUsers;
      break;
    case 'cms':
      this.faIcon = faCubes;
      break;
    case 'marketdata':
      this.faIcon = faPoll;
      break;
    case 'sfa':
      this.faIcon = faMagic;
      break;
    case 'marketing':
      this.faIcon = faAt;
      break;
    case 'object dist':
      this.faIcon = faNetworkWired;
      break;
    default:
      this.faIcon = faFileInvoice;
    }
  }
Example #2
Source File: index.js    From Webiu with MIT License 5 votes vote down vote up
GithubOrgMembers = ({orgname, title, auth_token, limit, showSearchBar}) => {

  const [loading, setLoading] = useState(true)
  const [members, setMembers] = useState(null)
  const [searchItem, setSearchItem] = useState("");
  const [searchResults, setSearchResults] = useState(members)

  useEffect(() => {
    const membersFetchUrl = `https://api.github.com/orgs/${orgname}/members?access_token=${auth_token}`
    setLoading(true)
    fetch(membersFetchUrl, { 
      method: 'GET', 
      headers: new Headers({
        'Authorization': auth_token, 
        'Content-Type': 'application/json'
    })})
    .then((res) => res.json()).then((data) => {
      setMembers(data)
      setSearchResults(data)
      setLoading(false)
    })
    .catch((err) => { throw err });
  }, [orgname, auth_token])

  const handleSearch = async (searchItem) => {
    const results = members.filter(member =>
      member.login.toLowerCase().includes(searchItem)
    );
    setSearchItem(searchItem);
    setSearchResults(results);
  }

  return (
    <div className="github-members-component">
      {title ? <div className="header-component">
        <h2>
          <FontAwesomeIcon className="icon-h2" icon={faGithub} /> <span className="h2-title">{title} {orgname}</span>
        </h2>
      </div> : null}
      {members && !members.message ? 
      <Container>
        {loading && <p>Fetching the profile</p>}
        <div className="contributors-search">
           {showSearchBar ? 
             <SearchBar input={searchItem} handleSearch={handleSearch} placeHolder="Search Members" />
            : null}
        </div>

        <Row>
            {searchResults &&  searchResults.map((member, index) => {
                if(index < limit){
                    return (
                        <div className="member-card" key={index} onClick={() => window.open(member.html_url, "_blank")}>
                            <div>
                              <img src={member.avatar_url} alt="Profile-img" className="member-img" />
                            </div>                      
                            <p className="member-title">{member.login}</p>
                        </div>
                    )
                }               
            })}
        </Row>
        <div style={{textAlign: "center", paddingBottom: "10px"}}>
            <p className="member-para">
              <FontAwesomeIcon className="icon" icon={faCubes} /> The Building Blocks of {orgname}
            </p>
        </div>
      </Container>  
      : <div style={{textAlign: "center"}}>
          <h2>Organization Not Found, Please Check the orgname or the Auth-Token</h2>
        </div>}   
    </div>
  )
}