Skip to content

Commit

Permalink
Merge pull request #817 from yash-shewalkar/main
Browse files Browse the repository at this point in the history
feat: add direct URL support for opening Feedback popup
  • Loading branch information
ArendPeter authored Feb 24, 2025
2 parents 1c2e4b8 + e43432d commit 0dd3e2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const App = () => {
}}>
<Routes>
<Route path='/' element={<LandingPage />} />
<Route path='/Feedback' element={<LandingPage />} /> // creating a new route for feedback page while still loading the landing page
<Route path='/About' element={<About />} />
<Route path='/ElectionInvitations' element={<ElectionInvitations />} />
<Route path='/ElectionsYouManage' element={<ElectionsYouManage />} />
Expand Down
15 changes: 13 additions & 2 deletions packages/frontend/src/components/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,21 @@ import useFeatureFlags from './FeatureFlagContextProvider';
import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
import LandingPageStats from './LandingPage/LandingPageStats';
import { ReturnToClassicContext } from './ReturnToClassicDialog';
import { useSubstitutedTranslation } from './util';

import { openFeedback, useSubstitutedTranslation } from './util';
import{useLocation} from 'react-router-dom';

const LandingPage = () => {

const checkUrl = useLocation();
useEffect(() =>{
if(checkUrl.pathname === "/Feedback")
{
openFeedback();
}

}, [checkUrl]);


const flags = useFeatureFlags();

const boxRef = useRef(null);
Expand Down

0 comments on commit 0dd3e2b

Please sign in to comment.