adjust container size

This commit is contained in:
Kalle (Sendou) 2020-11-18 01:16:45 +02:00
parent 36642d88a2
commit 8a10eb265d
2 changed files with 2 additions and 25 deletions

View File

@ -16,16 +16,7 @@ const MyInfiniteScroller: React.FC = ({ children }) => {
loadMore={(page) => setElementsToShow(page * 12)}
hasMore={elementsToShow < children.length}
>
<Flex
flexWrap="wrap"
width="100vw"
position="relative"
left="50%"
right="50%"
mx="-50vw"
justifyContent="center"
mt={4}
>
<Flex flexWrap="wrap" justifyContent="center" mt={4}>
{children.slice(0, elementsToShow)}
</Flex>
</InfiniteScroll>

View File

@ -2,20 +2,11 @@ import { Container, Flex, useToast } from "@chakra-ui/react";
import { t } from "@lingui/macro";
import { getToastOptions } from "lib/getToastOptions";
import { AppProps } from "next/app";
import { useRouter } from "next/dist/client/router";
import { SWRConfig } from "swr";
import Footer from "./Footer";
import IconNavBar from "./IconNavBar";
import TopNav from "./TopNav";
const PAGES_WITH_WIDE_CONTAINER = [
"/analyzer",
"/xsearch",
"/builds",
"/plans",
"/xleaderboards",
];
function reviver(key: any, value: any) {
if (Array.isArray(value)) {
return value.map((entry) => {
@ -33,7 +24,6 @@ function reviver(key: any, value: any) {
const Layout = ({ Component, pageProps }: AppProps) => {
const toast = useToast();
const pathname = useRouter().pathname;
return (
<SWRConfig
@ -56,11 +46,7 @@ const Layout = ({ Component, pageProps }: AppProps) => {
<TopNav />
<IconNavBar />
<Flex flexDirection="column" minH="100vh" pt="1rem">
<Container
maxWidth={
PAGES_WITH_WIDE_CONTAINER.includes(pathname) ? "120ch" : "70ch"
}
>
<Container maxWidth="100ch">
<Component {...pageProps} />
</Container>
<Footer />