kopia lustrzana https://github.com/bugout-dev/moonstream
reduce horizontal margins in mobile view
rodzic
9db654ea41
commit
2035fe9869
|
@ -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
|
||||||
|
|
Ładowanie…
Reference in New Issue