added screen witch custom component

parent 1c7e1849
import { memo, useState, useEffect } from 'react';
const SetWindowSize = () => {
const [windowWidth, setWindowWidth] = useState(0);
const [windowHeight, setWindowHeight] = useState(0);
useEffect(() => {
const updateWindowDimensions = () => {
const newWindowWidth = window.innerWidth;
const newWindowHeight = window.innerHeight;
setWindowWidth(newWindowWidth);
setWindowHeight(newWindowHeight);
};
// Call the function to update dimensions on mount
updateWindowDimensions();
// Event listener to update dimensions on resize
window.addEventListener('resize', updateWindowDimensions);
// Cleanup
return () => window.removeEventListener('resize', updateWindowDimensions);
}, []);
return [windowWidth, windowHeight];
};
export default SetWindowSize;
// export const base_url = 'http://localhost:4000' export const base_url = 'http://localhost:4000'
export const base_url = 'https://nisumscorecardserverdev.netlify.app/.netlify/functions/api' // export const base_url = 'https://nisumscorecardserverdev.netlify.app/.netlify/functions/api'
// export const base_url = 'https://nisumscorecardservertesting.netlify.app/.netlify/functions/api' // export const base_url = 'https://nisumscorecardservertesting.netlify.app/.netlify/functions/api'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment