@material-ui/core/#Container JavaScript Examples

The following examples show how to use @material-ui/core/#Container. 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: Routes.js    From reddish with MIT License 6 votes vote down vote up
Routes = () => {
  const classes = useMainPaperStyles();

  return (
    <Switch>
      <Route exact path="/">
        <Container disableGutters className={classes.homepage}>
          <div className={classes.postsPanel}>
            <PostFormModal />
            <PostList />
          </div>
          <TopSubsPanel />
        </Container>
      </Route>
      <Route exact path="/comments/:id">
        <PostCommentsPage />
      </Route>
      <Route exact path="/u/:username">
        <UserPage />
      </Route>
      <Route exact path="/r/:sub">
        <SubPage />
      </Route>
      <Route exact path="/search/:query">
        <SearchResults />
      </Route>
      <Route>
        <NotFoundPage />
      </Route>
    </Switch>
  );
}
Example #2
Source File: SubscriptionPage.js    From youtube-clone with MIT License 6 votes vote down vote up
HomePage = () => {
  const [videoResults, setVideoResult] = useState([]);
  const classes = useStyles();

  useEffect(() => {
    const fetchVideoContent = async () => {
      try {
        const {
          data: { videos },
        } = await api.get(`/api/videos/subscription`);
        setVideoResult(videos || []);
      } catch (err) {
        setVideoResult([]);
      }
    };
    fetchVideoContent();
  }, []);

  return (
    <Container maxWidth="xl" className={classes.root}>
      {videoResults.length ? (
        <VideoGrid type="vertical_2" videos={videoResults} />
      ) : (
        <Typography variant="body1">No subscription videos</Typography>
      )}
    </Container>
  );
}
Example #3
Source File: HomePage.js    From youtube-clone with MIT License 5 votes vote down vote up
HomePage = () => {
  const recommendedVids = useSelector(({ videos }) => videos.recommended);
  const trendingVids = useSelector(({ videos }) => videos.trending);
  const isLoading = useSelector(({ videos }) => videos.isLoading);
  const dispatch = useDispatch();

  useEffect(() => {
    dispatch(getHomeVideos());
  }, []);
  const classes = useStyles();
  let theme = createMuiTheme();
  theme = responsiveFontSizes(theme);
  return (
    <div>
      <Banner closeable>
        <div className={classes.banner}>
          <img
            className={classes.bannerImg}
            alt="youtube icon"
            src={youtubeIcon}
          />
          <div>
            <ThemeProvider theme={theme}>
              <Typography variant="h2"> FullStack Clone</Typography>
              <Typography variant="h4">
                <a
                  style={{
                    color: "red",
                  }}
                  href="https://github.com/smfils1/youtube-clone"
                >
                  GitHub Repo
                </a>
              </Typography>
              <Typography variant="body2">
                * for Educational Purposes
              </Typography>
            </ThemeProvider>
          </div>
        </div>
      </Banner>
      <Container maxWidth="xl" className={classes.root}>
        <Typography variant="h5" className={classes.text}>
          Recommended
        </Typography>

        <VideoGrid
          type="vertical_2"
          isLoading={isLoading}
          videos={recommendedVids}
        />
        <Divider light className={classes.divider} />
        <Typography variant="h5" className={classes.text}>
          Trending
        </Typography>
        <VideoGrid
          type="vertical_2"
          isLoading={isLoading}
          videos={trendingVids}
        />
      </Container>
    </div>
  );
}