-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06bb24b
commit 888ecf4
Showing
15 changed files
with
2,861 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
frontend/public/classic_star_vote_files/analytics.js(1).download
Large diffs are not rendered by default.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
frontend/public/classic_star_vote_files/analytics.js.download
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
frontend/public/classic_star_vote_files/jquery-2.1.4.min.js.download
Large diffs are not rendered by default.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
frontend/public/classic_star_vote_files/jquery.mobile-1.4.5.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
frontend/public/classic_star_vote_files/jquery.mobile-1.4.5.min.js.download
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import { useLocalStorage } from '../hooks/useLocalStorage' | ||
import { useNavigate } from 'react-router' | ||
|
||
const ClassicPrompt = () => { | ||
const navigate = useNavigate() | ||
|
||
const [prevClassicPrompt, setPrevClassicPrompt] = useLocalStorage('prev_classic_prompt', '') | ||
const [rememberPrompt, setRememberPrompt] = useState(false) | ||
|
||
function goToOriginal(){ | ||
if(rememberPrompt) setPrevClassicPrompt('classic') | ||
|
||
window.location.href = 'https://www.star.vote'; | ||
} | ||
|
||
function goToNewVersion(){ | ||
|
||
// navigate({ pathname: '/Landing'}); | ||
|
||
window.location.href = 'Landing'; | ||
|
||
if(rememberPrompt) setPrevClassicPrompt('new_version') | ||
} | ||
|
||
function handleCheckbox(event){ | ||
setRememberPrompt(event.target.checked) | ||
} | ||
|
||
useEffect(() => { | ||
if(prevClassicPrompt == 'classic'){ | ||
goToOriginal() | ||
} | ||
|
||
if(prevClassicPrompt == 'new_version'){ | ||
goToNewVersion() | ||
} | ||
}); | ||
|
||
if(prevClassicPrompt != '') return <></> // save on rendering time so the redirect is faster | ||
|
||
return ( | ||
<> | ||
<div className="classicPageWrapper"> | ||
<iframe src='classic_star_vote.html' style={{width: '100%', height: '100%'}} scrolling="no"></iframe> | ||
</div> | ||
<div className="classicPopupBkg"> | ||
<div className="classicPopupInner"> | ||
We're working on a new and improved version of star.vote! | ||
<br/> | ||
Want to try it? | ||
<br/> | ||
<button onClick={goToOriginal}>Continue to Original</button> | ||
<button onClick={goToNewVersion}>Try New Verison</button> | ||
<br/> | ||
<input type="checkbox" onChange={handleCheckbox}/> Remember my selection | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default ClassicPrompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters