Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nisum-scorecard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Venkaiah Naidu Singamchetty
nisum-scorecard
Commits
b3b35fa9
Commit
b3b35fa9
authored
Mar 19, 2024
by
Venkaiah Naidu Singamchetty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added screen witch custom component
parent
1c7e1849
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
SetWindowSize.js
src/utils/SetWindowSize.js
+28
-0
constants.js
src/utils/constants.js
+2
-2
No files found.
src/utils/SetWindowSize.js
0 → 100644
View file @
b3b35fa9
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
;
src/utils/constants.js
View file @
b3b35fa9
//
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment