Skip to content

Commit d684af8

Browse files
authored
Merge pull request #231 from CivicDataLab/230-add-translation-drop-down-in-mobile-nav
Add translation drop down in mobile nav
2 parents 11c0235 + c155c0c commit d684af8

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

components/mobile-nav.tsx

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import Image from 'next/image';
55
import Link from 'next/link';
66
import { useKeyDetect } from '@/hooks/use-key-detect';
77
import { MainConfig } from '@/types';
8-
import { Button, Icon, IconButton, Text } from 'opub-ui';
8+
import { IconButton, Text } from 'opub-ui';
99

10+
import { getPrefLangCookie } from '@/lib/serverUtils';
1011
import { handleRedirect } from '@/lib/utils';
1112
import { Icons } from '@/components/icons';
13+
import { TranslateDropdown } from './langSelect/lang-select';
1214

1315
export function MobileNav({ data }: { data: MainConfig }) {
1416
const [open, setOpen] = React.useState(false);
@@ -67,24 +69,27 @@ export function MobileNav({ data }: { data: MainConfig }) {
6769
className="fixed z-10 flex h-[95vh] w-[100vw] flex-shrink-0 flex-col items-start justify-between border-t-1 border-solid border-baseGraySlateSolid11 bg-backgroundSolidDark px-5 py-8 text-textOnBGDefault"
6870
style={{ zIndex: '100009' }}
6971
>
70-
<div className="flex w-full items-center gap-3 p-3 pr-5">
71-
{data.mainNav.length > 0 && (
72-
<div>
73-
{data.mainNav.map((link) => (
74-
<ExploreLink
75-
key={link.title}
76-
href={link.href || ''}
77-
icon={link.icon || ''}
78-
text={link.title || ''}
79-
onClick={toggleMenu}
80-
/>
81-
))}
82-
</div>
83-
)}
72+
<div className="">
73+
<div className="flex w-full items-center gap-3 p-3 pr-5">
74+
{data.mainNav.length > 0 && (
75+
<div>
76+
{data.mainNav.map((link) => (
77+
<ExploreLink
78+
key={link.title}
79+
href={link.href || ''}
80+
icon={link.icon || ''}
81+
text={link.title || ''}
82+
onClick={toggleMenu}
83+
/>
84+
))}
85+
</div>
86+
)}
87+
</div>
88+
<TranslateDropdown prefLangCookie={getPrefLangCookie()} />
8489
</div>
8590
<footer className="flex flex-col flex-wrap items-start gap-1 self-stretch bg-backgroundSolidDark px-5 py-4">
8691
<div className="flex flex-col items-center justify-center gap-4 self-center">
87-
<div className=" ">
92+
<div>
8893
<Text variant="headingSmSpaced" color="onBgDefault">
8994
<strong>
9095
made with{' '}

0 commit comments

Comments
 (0)