@material-ui/icons#NavigateNext JavaScript Examples

The following examples show how to use @material-ui/icons#NavigateNext. 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: Pager.js    From web-wallet with Apache License 2.0 6 votes vote down vote up
function Pager ({ currentPage, isLastPage, onClickNext, onClickBack }) {
  return (
    <div className={styles.Pager}>
      <span className={styles.number}>{`Page ${currentPage}`}</span>
      <div
        className={[
          styles.box,
          currentPage === 1 ? styles.disabled : ''
        ].join(' ')}
        onClick={onClickBack}
      >
        <NavigateBefore className={styles.icon} />
      </div>
      <div
        className={[
          styles.box,
          isLastPage ? styles.disabled : ''
        ].join(' ')}
        onClick={onClickNext}
      >
        <NavigateNext className={styles.icon} />
      </div>
    </div>
  );
}
Example #2
Source File: Image.js    From Dog-Book with MIT License 5 votes vote down vote up
Image = (props) => {
  const { breedName } = props;
  const [loaded, setLoaded] = useState(false);
  const [imgUrl, setImgUrl] = useState(undefined);
  useEffect(() => {
    if (breedName !== null) {
      trackPromise(
        axios
          .get(`https://dog.ceo/api/breed/${breedName}/images/random`)
          .then((response) => {
            const url = response.data.message.toString();
            setImgUrl(url);
          })
      );
    }
  }, [breedName]);
  const manageRefresh = () => {
    trackPromise(
      axios
        .get(`https://dog.ceo/api/breed/${breedName}/images/random`)
        .then((response) => {
          const url = response.data.message.toString();
          setImgUrl(url);
        })
    );
  };

  return (
    <Card>
      <CardMedia
        title="Dogs Image"
        style={{ display: loaded ? "block" : "none" }}
      >
        <LoadingIndicator />
        <img
          src={imgUrl}
          onLoad={() => setLoaded(true)}
          alt={breedName}
          style={({ height: "300px" }, { width: "100%" })}
        />
      </CardMedia>
      <Skeleton
        height={300}
        variant="rect"
        style={{ display: !loaded ? "block" : "none" }}
      />
      <CardContent>
        <Typography
          gutterBottom
          variant="h5"
          component="h2"
          style={{ textTransform: "capitalize" }}
        >
          {breedName === null ? "No Breed Selected" : breedName}
        </Typography>
      </CardContent>
      <CardActions>
        <Button
          variant="contained"
          color="secondary"
          onClick={manageRefresh}
          startIcon={<NavigateNext />}
        >
          Next Image
        </Button>
      </CardActions>
    </Card>
  );
}