Skip to content

Commit

Permalink
Added Africa page placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
codeaid committed Aug 18, 2023
1 parent ed0c5cd commit 799b042
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/Toolbar/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export const Toolbar = (props: ToolbarProps) => {
children: translate('POI:MAP_NAME_ALASKA'),
href: '/alaska',
},
{
children: translate('POI:MAP_NAME_AFRICA'),
href: '/africa',
},
].map((action, index) => (
<NavLink
activeClassName={styles.ToolbarActionActive}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const getGenericMarkerKey = (
case 'lodge':
return 'TOOLBOX:MARKER_LODGE';
case 'parking':
return 'TOOLBOX:MARKER_PARKING';
return 'UI:MARKER_PARKING';
case 'photo':
return 'UI:MARKER_PHOTO';
case 'shooting range':
Expand Down
46 changes: 46 additions & 0 deletions src/pages/africa/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import Head from 'next/head';
import { useEffect } from 'react';
import { createPortal } from 'react-dom';
import { Modal } from 'components/Modal';
import { useHuntingMapType, useTranslator, useTutorial } from 'hooks';
import styles from './styles.module.css';

const AfricaPage = () => {
// Retrieve map type switcher
const { onSetMapType } = useHuntingMapType();

// Render map tutorial dialog
const { component: tutorial } = useTutorial(true);

// Retrieve application translator
const translate = useTranslator();

// Toggle currently active map type on page load and unload
useEffect(() => {
onSetMapType('africa');
return () => onSetMapType();
}, [onSetMapType]);

return (
<>
<Head>
<title>
{`${translate('POI:MAP_NAME_AFRICA')} - ${translate(
'UI:GAME_TITLE',
)}`}
</title>
</Head>

<Modal blur={false} canClose={false} header="Notice">
<div className={styles.AfricaPageNotice}>
{translate('POI:MAP_NAME_AFRICA')} will be unlocked on Monday, 21
August
</div>
</Modal>

{createPortal(tutorial, document.body)}
</>
);
};

export default AfricaPage;
6 changes: 6 additions & 0 deletions src/pages/africa/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.AfricaPageNotice {
font-family: 'Fira Sans Condensed', sans-serif;
font-size: 1.7em;
line-height: 1.5em;
text-align: center;
}
2 changes: 1 addition & 1 deletion src/types/cartography.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface MapOptions {
mapWidth: number;
}

export type MapType = 'alaska' | 'idaho' | 'transylvania';
export type MapType = 'africa' | 'alaska' | 'idaho' | 'transylvania';

export interface MapZoomOptions {
zoomMax: number;
Expand Down

0 comments on commit 799b042

Please sign in to comment.