Parcourir la source

try to fix slider

GA
Pavle Golubovic il y a 3 ans
Parent
révision
ae7126067c

+ 1
- 1
frontend/src/components/ProcessSection.jsx Voir le fichier

@@ -22,7 +22,7 @@ const ProcessSection = () => {
const windowInfo = useWindowSize();

useEffect(() => {
console.log(windowInfo.width);
//console.log(windowInfo.width);
if (windowInfo.width < 1000)
setIsMobile(true);
else

+ 0
- 1
frontend/src/hooks/useWindowSize.js Voir le fichier

@@ -3,7 +3,6 @@ import React, {useState, useEffect} from "react";

const useWindowSize = () => {
// Initialize state with undefined width/height so server and client renders match
// Learn more here: https://joshwcomeau.com/react/the-perils-of-rehydration/
const [windowSize, setWindowSize] = useState({
width: undefined,
height: undefined,

+ 5
- 3
frontend/src/pages/ProcessPage.jsx Voir le fichier

@@ -134,9 +134,11 @@ const ProcessPage = () => {
//useAnalytics();

useEffect(() => {
if (windowInfo.width < 1000) setIsMobile(true);
else setIsMobile(false);
}, [windowInfo]);
if (windowInfo.width < 1000)
setIsMobile(true);
else
setIsMobile(false);
},[windowInfo]);

return (
<PageLayout>

Chargement…
Annuler
Enregistrer