diff --git a/client/src/pages/Initial/LandingPage.jsx b/client/src/pages/Initial/LandingPage.jsx
index 886cac9a..6ddff0e1 100644
--- a/client/src/pages/Initial/LandingPage.jsx
+++ b/client/src/pages/Initial/LandingPage.jsx
@@ -1,78 +1,47 @@
import React, { useEffect, useState } from 'react';
-// F!rosh 2T3 Landing Pages
-import { TanuLanding } from './TanuLanding/TanuLanding';
-import { UzmaLanding } from './UzmaLanding/UzmaLanding';
-import { NatLanding } from './NatLanding/NatLanding';
-import { SherryLanding } from './SherryLanding/SherryLanding';
-
// F!rosh 2T4 Landing Pages
import { AshLanding } from './AshLanding/AshLanding';
-const currentYear = '2T4';
-
const landingPages = [
{
key: 0,
- component: ,
- year: '2T3',
+ component: ,
},
{
key: 1,
- component: ,
- year: '2T3',
- },
- {
- key: 2,
- component: ,
- year: '2T3',
- },
- {
- key: 3,
- component: ,
- year: '2T3',
- },
- {
- key: 4,
component: ,
- year: '2T4',
},
];
-// Change this logic to determine which landing pages to show
-const landingPagesFiltered = landingPages.filter((page) => page.year === currentYear);
-
function randomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
export const LandingPage = () => {
const [pageIndex, setPageIndex] = useState(null);
+
useEffect(() => {
- if (landingPagesFiltered.length !== 1) {
- let randIdx = randomNumber(0, landingPagesFiltered.length - 1);
- const localIdx = window.localStorage.getItem('landing_page_idx');
+ let randIdx = randomNumber(0, landingPages.length - 1);
+ const localIdx = window.localStorage.getItem('landing_page_idx');
- if (localIdx !== null) {
- while (randIdx === JSON.parse(localIdx)) {
- randIdx = randomNumber(0, landingPagesFiltered.length - 1);
- }
+ if (localIdx !== null) {
+ while (randIdx === JSON.parse(localIdx)) {
+ randIdx = randomNumber(0, landingPages.length - 1);
}
- window.localStorage.setItem('landing_page_idx', JSON.stringify(randIdx));
- setPageIndex(JSON.parse(randIdx));
}
+ window.localStorage.setItem('landing_page_idx', JSON.stringify(randIdx));
+
+ setPageIndex(JSON.parse(randIdx));
}, []);
return (
<>
- {landingPagesFiltered.length === 1
- ? landingPagesFiltered[0].component
- : landingPagesFiltered.map((item) => {
- if (item.key === pageIndex) {
- return
{item.component}
;
- }
- return null;
- })}
+ {landingPages.map((item) => {
+ if (item.key == pageIndex) {
+ return {item.component}
;
+ }
+ })}
>
);
};