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

The following examples show how to use @fortawesome/free-solid-svg-icons#faPlug. 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: fontawesome.js    From xmrig-workers with GNU General Public License v3.0 5 votes vote down vote up
export default function () {
  library.add(faGithub, faWindows, faLinux, faTwitter, faReddit, faTelegram, faCheckCircle, faMicrochip, faTrashAlt,
    faPaperPlane, faSpinner, faFlask, faInfoCircle, faPen, faTools, faCheck, faPlus, faCog, faExclamationTriangle,
    faQuestionCircle, faSyncAlt, faInfinity, faDownload, faCopy, faPlug, faTimesCircle);
}
Example #2
Source File: index.jsx    From loopring-swap with GNU General Public License v3.0 4 votes vote down vote up
Drawer = ({
    open,
    onClose,
    onConnectWallet,
    selectedWeb3Account,
    onLogin,
    onRegister,
    needsRegistration,
    loadingAuthStatus,
    onLogout,
    loggedIn,
    darkTheme,
    onDarkThemeChange,
    selectedLanguage,
    onSelectedLanguageChange,
}) => {
    const container = useRef(null);

    const [icon, setIcon] = useState(faLock);
    const [iconColor, setIconColor] = useState("");
    const [summaryMessageKey, setSummaryMessageKey] = useState("placeholder");
    const [buttonMessageKey, setButtonMessageKey] = useState("placeholder");

    useLayoutEffect(() => {
        if (needsRegistration) {
            setIcon(faUserPlus);
            setIconColor(selectedTheme.primary);
            setSummaryMessageKey("drawer.wallet.connect.register");
            setButtonMessageKey("drawer.wallet.connect.action.register");
        } else if (loggedIn) {
            setIcon(faLockOpen);
            setIconColor(selectedTheme.success);
            setSummaryMessageKey("drawer.wallet.connect.logout");
            setButtonMessageKey("drawer.wallet.connect.action.logout");
        } else if (selectedWeb3Account) {
            setIcon(faLock);
            setIconColor(selectedTheme.error);
            setSummaryMessageKey("drawer.wallet.connect.login");
            setButtonMessageKey("drawer.wallet.connect.action.login");
        } else {
            setIcon(faPlug);
            setIconColor(selectedTheme.primary);
            setSummaryMessageKey("drawer.wallet.connect.summary");
            setButtonMessageKey("drawer.wallet.connect.action.connect");
        }
    }, [loggedIn, needsRegistration, selectedWeb3Account]);

    const handleButtonClick = useCallback(() => {
        if (needsRegistration) {
            onRegister();
        } else if (loggedIn) {
            onLogout();
        } else if (selectedWeb3Account) {
            onLogin();
        } else {
            onConnectWallet();
        }
    }, [
        loggedIn,
        needsRegistration,
        onConnectWallet,
        onLogin,
        onLogout,
        onRegister,
        selectedWeb3Account,
    ]);

    return (
        <RootFlex
            flexDirection="column"
            alignItems="center"
            open={open}
            ref={container}
        >
            <HeaderFlex mb={3}>
                <EllipsizedBox>
                    {selectedWeb3Account ? (
                        getShortenedEthereumAddress(selectedWeb3Account)
                    ) : (
                        <FormattedMessage id="drawer.wallet.connect.header.connect" />
                    )}
                </EllipsizedBox>
                <Box ml={3} minWidth="auto">
                    <CloseIcon icon={faTimes} onClick={onClose} />
                </Box>
            </HeaderFlex>
            <Box mb={3}>
                <Icon icon={icon} color={iconColor} fontSize="40" />
            </Box>
            <Box px={4} mb={3} fontSize="12px" textAlign="center">
                <SummaryMessage>
                    <FormattedMessage id={summaryMessageKey} />
                </SummaryMessage>
            </Box>
            <Box mb={4}>
                <Button onClick={handleButtonClick} loading={loadingAuthStatus}>
                    <FormattedMessage id={buttonMessageKey} />
                </Button>
            </Box>
            <Box width="100%" mb={2}>
                <Settings
                    darkTheme={darkTheme}
                    onDarkThemeChange={onDarkThemeChange}
                    selectedLanguage={selectedLanguage}
                    onSelectedLanguageChange={onSelectedLanguageChange}
                />
            </Box>
            <Box width="100%" mb={2}>
                <Lrc />
            </Box>
            <Box width="100%" mb={2}>
                <Support />
            </Box>
            <Box width="100%" mb={2}>
                <TechnicalResources />
            </Box>
            <Box width="100%" mb={2}>
                <ExchangeInfo />
            </Box>
        </RootFlex>
    );
}