Skip to content

Commit

Permalink
chore(SLB-410): add better styles for one language option
Browse files Browse the repository at this point in the history
  • Loading branch information
HagerDakroury committed Jun 14, 2024
1 parent 57922f6 commit 7e97502
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/ui/src/components/Molecules/LanguageSwitcher.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { Link, Locale, useLocation } from '@custom/schema';
import { Menu, MenuButton, MenuItems, Transition } from '@headlessui/react';
import {
Menu,
MenuButton,
MenuItem,
MenuItems,
Transition,
} from '@headlessui/react';
import { ChevronDownIcon } from '@heroicons/react/20/solid';
import clsx from 'clsx';
import React, { Fragment } from 'react';
Expand Down Expand Up @@ -32,6 +38,7 @@ export function LanguageSwitcher() {
'inline-flex justify-center w-full rounded-md bg-white text-sm',
{
'hover:text-blue-600': isMultiLingual,
'cursor-not-allowed opacity-70': !isMultiLingual,
},
)}
disabled={!isMultiLingual}
Expand All @@ -57,7 +64,7 @@ export function LanguageSwitcher() {
<React.Fragment key={locale}>
{translations[locale] &&
location.pathname !== translations[locale] ? (
<Menu.Item>
<MenuItem>
{({ focus }) =>
translations[locale] ? (
<Link
Expand All @@ -82,7 +89,7 @@ export function LanguageSwitcher() {
</span>
)
}
</Menu.Item>
</MenuItem>
) : null}
</React.Fragment>
))}
Expand Down

0 comments on commit 7e97502

Please sign in to comment.