reduce horizontal margins in mobile view

pull/129/head
Tim Pechersky 2021-08-20 13:50:42 +02:00
rodzic 9db654ea41
commit 2035fe9869
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
import React, { useEffect, useState, useLayoutEffect } from "react"; import React, { useEffect, useState, useLayoutEffect, useContext } from "react";
import { import {
Heading, Heading,
Text, Text,
@ -11,6 +11,7 @@ import {
ListItem, ListItem,
} from "@chakra-ui/react"; } from "@chakra-ui/react";
import { DEFAULT_METATAGS } from "../../src/components/constants"; import { DEFAULT_METATAGS } from "../../src/components/constants";
import UIContext from "../../src/core/providers/UIProvider/context";
export async function getStaticProps() { export async function getStaticProps() {
return { return {
@ -29,6 +30,7 @@ const assets = {
}; };
const Product = () => { const Product = () => {
const ui = useContext(UIContext);
const [background, setBackground] = useState("background720"); const [background, setBackground] = useState("background720");
const [backgroundLoaded720, setBackgroundLoaded720] = useState(false); const [backgroundLoaded720, setBackgroundLoaded720] = useState(false);
const [backgroundLoaded1920, setBackgroundLoaded1920] = useState(false); const [backgroundLoaded1920, setBackgroundLoaded1920] = useState(false);
@ -107,7 +109,7 @@ const Product = () => {
}; };
}, []); }, []);
const margin = "22%"; const margin = ui.isMobileView ? "7%" : "22%";
return ( return (
<Flex <Flex