Skip to content

Commit

Permalink
Show flag for region
Browse files Browse the repository at this point in the history
  • Loading branch information
dnhn committed Dec 21, 2024
1 parent ff1874d commit 160ff0f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions website/src/components/navbar/navbar-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const MobileNavigation = ({
navigation,
translations,
}: NavbarProps) => {
const isIntRegion = region === 'int';
const [visibleSection, setVisibleSection] = useState<
'main' | 'our-work' | 'about-us' | 'transparency' | 'i18n' | null
>(null);
Expand Down Expand Up @@ -221,9 +222,9 @@ const MobileNavigation = ({
{translations.myProfile}
</NavbarLink>
<div className="flex-inline flex items-center">
{country && (
{region && country && (
<Image
src={getFlagImageURL(country)}
src={getFlagImageURL(isIntRegion ? country : region)}
width={24}
height={24}
alt=""
Expand Down Expand Up @@ -280,6 +281,7 @@ const DesktopNavigation = ({
navigation,
translations,
}: NavbarProps) => {
const isIntRegion = region === 'int';
let { currency, setCurrency, setLanguage, setRegion } = useI18n();
const NavbarLink = ({ href, children, className }: { href: string; children: string; className?: string }) => (
<Link href={href} className={twMerge('hover:text-accent text-lg', className)}>
Expand Down Expand Up @@ -349,9 +351,9 @@ const DesktopNavigation = ({
</div>
<div className="group/i18n flex h-full flex-1 shrink-0 basis-1/4 flex-col">
<div className="flex flex-row items-baseline justify-end">
{country && (
{region && country && (
<Image
src={getFlagImageURL(country)}
src={getFlagImageURL(isIntRegion ? country : region)}
width={20}
height={20}
alt=""
Expand Down

0 comments on commit 160ff0f

Please sign in to comment.