@mui/icons-material#HelpOutlineRounded TypeScript Examples

The following examples show how to use @mui/icons-material#HelpOutlineRounded. 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: EnhancedTableHead.tsx    From yearn-watch-legacy with GNU Affero General Public License v3.0 5 votes vote down vote up
EnhancedTableHead = <T extends GenericListItem>(
    props: EnhancedTableProps<T>
) => {
    const {
        classes,
        order,
        orderBy,
        onRequestSort,
        shouldCollapse = false,
    } = props;
    const createSortHandler =
        (property: keyof GenericListItem) =>
        (event: React.MouseEvent<unknown>) => {
            onRequestSort(event, property);
        };

    const collapseCell = shouldCollapse ? (
        <TableCell key="collapse" align="center" padding="normal">
            Details
        </TableCell>
    ) : (
        ''
    );

    return (
        <TableHead>
            <TableRow>
                {collapseCell}
                {props.headCells.map((headCell, index) => (
                    <TableCell
                        key={`header-${index}`}
                        align={headCell.align}
                        padding={headCell.disablePadding ? 'none' : 'normal'}
                        sortDirection={orderBy === headCell.id ? order : false}
                    >
                        <>
                            <TableSortLabel
                                active={orderBy === headCell.id}
                                direction={
                                    orderBy === headCell.id ? order : 'asc'
                                }
                                onClick={
                                    headCell.id
                                        ? createSortHandler(headCell.id)
                                        : undefined
                                }
                            >
                                {headCell.label}
                                {orderBy === headCell.id ? (
                                    <span className={classes.visuallyHidden}>
                                        {order === 'desc'
                                            ? 'sorted descending'
                                            : 'sorted ascending'}
                                    </span>
                                ) : null}
                            </TableSortLabel>
                            {headCell.tooltip ? (
                                <Tooltip title={headCell.tooltip}>
                                    <HelpOutlineRounded fontSize="small" />
                                </Tooltip>
                            ) : (
                                ''
                            )}
                        </>
                    </TableCell>
                ))}
            </TableRow>
        </TableHead>
    );
}
Example #2
Source File: index.tsx    From yearn-watch-legacy with GNU Affero General Public License v3.0 4 votes vote down vote up
TokenPrice = (props: TokenPriceProps) => {
    const [tokenPrice, setTokenPrice] = useState<BigNumber>();
    const [tokenUnitPrice, setTokenUnitPrice] = useState<BigNumber>();
    const {
        label = 'Token Price (USD):',
        loadingLabel = `Getting ${props.token.symbol}/USDC price...`,
    } = props;

    const classes = useStyles();

    useEffect(() => {
        if (isUSDC(props.token.address, props.network)) {
            setTokenUnitPrice(new BigNumber(1));
            setTokenPrice(toUnits(props.amount.toString(), USDC_DECIMALS));
        } else {
            getTokenUnitPrice(props.token, props.network).then(
                (unitPrice: BigNumber) => {
                    setTokenUnitPrice(unitPrice);
                }
            );
            getTokenPrice(
                props.token,
                props.amount.toString(),
                props.network
            ).then((usdcAmount: BigNumber) => {
                setTokenPrice(usdcAmount);
            });
        }
    }, []);

    if (!tokenPrice || !tokenUnitPrice) {
        return (
            <StyledTableRow>
                <StyledTableCell>
                    {label}
                    <MediaQuery query="(max-device-width: 1224px)">
                        <CircularProgress color="inherit" size="0.6rem" />{' '}
                        {loadingLabel}
                    </MediaQuery>
                </StyledTableCell>
                <MediaQuery query="(min-device-width: 1224px)">
                    <StyledTableCell>
                        <CircularProgress color="inherit" size="0.6rem" />{' '}
                        {loadingLabel}
                    </StyledTableCell>
                </MediaQuery>
            </StyledTableRow>
        );
    }
    const tooltip = (
        <HtmlTooltip
            title={
                <Fragment>
                    <Typography color="inherit">
                        {'Token Unit Price'}
                    </Typography>
                    {`1 ${props.token.symbol} ~= ${tokenUnitPrice?.toFixed(
                        4
                    )} USDC`}
                </Fragment>
            }
        >
            <HelpOutlineRounded fontSize="small" className={classes.helpIcon} />
        </HtmlTooltip>
    );

    return (
        <StyledTableRow bckDark={props.bckDark ? 'true' : 'false'}>
            <StyledTableCell>
                <SubTitle> {label}</SubTitle>
                <MediaQuery query="(max-device-width: 1224px)">
                    <br />
                    <LabelTypography>
                        {tokenPrice
                            ? displayAmount(tokenPrice?.toFixed(2), 0)
                            : '-'}
                        USD
                    </LabelTypography>
                </MediaQuery>
            </StyledTableCell>
            <MediaQuery query="(min-device-width: 1224px)">
                <StyledTableCell>
                    <LabelTypography>
                        {tokenPrice
                            ? `${displayAmount(tokenPrice?.toFixed(2), 0)} USD`
                            : '-'}
                    </LabelTypography>
                    {tooltip}
                </StyledTableCell>
            </MediaQuery>
        </StyledTableRow>
    );
}