File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ import type { FunctionComponent } from 'preact' ;
2+
3+ const dayLeftString = ( days : number ) : string => {
4+ if ( days === 0 ) {
5+ return 'Less than a day left!' ;
6+ } else if ( days === 1 ) {
7+ return 'Just one day left!' ;
8+ } else {
9+ return `Just ${ days } days left!` ;
10+ }
11+ } ;
12+
13+ const Promo : FunctionComponent = ( ) => {
14+ const now = Date . now ( ) ;
15+ const daysLeft = Math . floor ( ( 1752735600000 - now ) / ( 86400 * 1000 ) ) ;
16+ if ( daysLeft < 0 ) {
17+ return null ;
18+ } else {
19+ return (
20+ < p class = "votenote" >
21+ < strong > { dayLeftString ( daysLeft ) } </ strong > Please consider{ ' ' }
22+ < a target = "_blank" href = "https://www.youtube.com/shorts/4h8mYt6qnlw" >
23+ voting for Jaspinko in the GeoGuessr Remix challenge
24+ </ a >
25+ !
26+ </ p >
27+ ) ;
28+ }
29+ } ;
30+
31+ export default Promo ;
Original file line number Diff line number Diff line change @@ -9,13 +9,15 @@ import { render } from 'preact';
99import About from './About' ;
1010import Data from './Data' ;
1111import Game from './Game' ;
12+ import Promo from './Promo' ;
1213import Providers from './Providers' ;
1314import Results from './Results' ;
1415import './style.css' ;
1516
1617const App = ( ) => (
1718 < Providers >
1819 < h1 > tpg solver</ h1 >
20+ < Promo />
1921 < Game />
2022 < Data />
2123 < Results />
Original file line number Diff line number Diff line change @@ -207,3 +207,7 @@ a:any-link {
207207 text-decoration : underline;
208208 cursor : pointer;
209209}
210+
211+ .votenote {
212+ color : var (--error-color );
213+ }
You can’t perform that action at this time.
0 commit comments