This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
SelectValueText,
|
||||
} from '@/components/ui/collections/select';
|
||||
import { useParams } from 'next/navigation';
|
||||
import { createListCollection } from '@chakra-ui/react';
|
||||
import { createListCollection, ClientOnly } from '@chakra-ui/react';
|
||||
import { usePathname, useRouter } from '@/i18n/navigation';
|
||||
|
||||
const LocaleSwitcher = () => {
|
||||
@@ -40,27 +40,29 @@ const LocaleSwitcher = () => {
|
||||
});
|
||||
}
|
||||
return (
|
||||
<SelectRoot
|
||||
disabled={isPending}
|
||||
value={[locale]}
|
||||
onValueChange={onSelectChange}
|
||||
w={{ base: 'full', lg: '24' }}
|
||||
size='sm'
|
||||
variant='outline'
|
||||
borderRadius='md'
|
||||
collection={collections}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValueText placeholder='Select a language' />
|
||||
</SelectTrigger>
|
||||
<SelectContent zIndex='9999'>
|
||||
{collections.items.map((collection) => (
|
||||
<SelectItem key={collection.value} item={collection}>
|
||||
{collection.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</SelectRoot>
|
||||
<ClientOnly fallback={<div style={{ height: '32px' }} />}>
|
||||
<SelectRoot
|
||||
disabled={isPending}
|
||||
value={[locale]}
|
||||
onValueChange={onSelectChange}
|
||||
w={{ base: 'full', lg: '24' }}
|
||||
size='sm'
|
||||
variant='outline'
|
||||
borderRadius='md'
|
||||
collection={collections}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValueText placeholder='Select a language' />
|
||||
</SelectTrigger>
|
||||
<SelectContent zIndex='9999'>
|
||||
{collections.items.map((collection) => (
|
||||
<SelectItem key={collection.value} item={collection}>
|
||||
{collection.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</SelectRoot>
|
||||
</ClientOnly>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user