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

The following examples show how to use @fortawesome/free-solid-svg-icons#faSearchDollar. 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: App.tsx    From lp-inspector with MIT License 4 votes vote down vote up
function App() {
  const [contractAddress, setContractAddress] = useState("");
  const [routercontractAddress, setRouterContractAddress] = useState(
    PANCAKE_ROUTER
  );
  const [address, setAddress] = useState<string>(
    wa.web3 ? "" : localStorage.getItem("address") || ""
  );
  const [showDetails, setShowDetails] = useState<boolean>(false);

  useEffect(() => {
    setShowDetails(contractAddress !== "" && routercontractAddress !== "");

    return () => {
      setShowDetails(false);
    };
  }, [routercontractAddress, contractAddress, showDetails]);

  function updateWalletAddress(_address: string) {
    setAddress(_address);
    localStorage.setItem("address", _address);
  }

  return (
    <Web3ReactProvider getLibrary={getLibrary}>
      <div className="app-container">
        <div className="app-content-container">
          <div className="app-header">
            <div className="app-header-left">
              <FontAwesomeIcon icon={faSearchDollar} className="app-icon" />
              <h1>How much is my LP worth?</h1>
            </div>
            {wa.web3 && (
              <ConnectWallet callback={setAddress}>Connect</ConnectWallet>
            )}
          </div>
          {address || !wa.web3 ? (
            <>
              {!wa.web3 && (
                <AddressInput
                  placeholder="Enter your address"
                  label="Your address"
                  defaultValue={address}
                  callback={updateWalletAddress}
                />
              )}
              <AddressInput
                placeholder="Enter Masterchef address"
                label="MasterChef address"
                presets={masterChefPresets}
                callback={setContractAddress}
              />
              <AddressInput
                placeholder="Enter Router address"
                label="Router address (default to Pancakeswap)"
                defaultValue={routercontractAddress}
                presets={routerPresets}
                callback={setRouterContractAddress}
              />
              <div className="app-details-section">
                {showDetails ? (
                  <BalanceDetails
                    address={address}
                    contractAddress={contractAddress}
                    routerContractAddress={routercontractAddress}
                  />
                ) : (
                  <p>Fill contract addresses above to see details here.</p>
                )}
              </div>
            </>
          ) : (
            <p className="app-connect-wallet-first">
              Connect wallet to use the app.
            </p>
          )}
          <Footer showDonate={address !== ""} />
        </div>
      </div>
    </Web3ReactProvider>
  );
}