Fixed collapse state of website select.

This commit is contained in:
Mike Cao 2026-02-07 23:56:06 -08:00
parent 08e4da27c1
commit d26ed3b949
5 changed files with 48 additions and 15 deletions

View file

@ -55,6 +55,7 @@ export function WebsiteNav({
teamId={teamId}
onChange={handleChange}
buttonProps={{ style: { outline: 'none' } }}
isCollapsed={isCollapsed}
/>
</Box>
{items.map(({ label: sectionLabel, items: sectionItems }, index) => (

View file

@ -18,13 +18,6 @@ html[style*="padding-right"] {
padding-right: 0 !important;
}
a,
a:active,
a:hover {
color: var(--text-primary);
text-decoration: none;
}
::-webkit-scrollbar {
width: 15px;
background: transparent;

View file

@ -1,4 +1,5 @@
import { ListItem, Row, Select, type SelectProps, Text } from '@umami/react-zen';
import { Icon, ListItem, Row, Select, type SelectProps, Text } from '@umami/react-zen';
import { ChevronRight } from 'lucide-react';
import { useState } from 'react';
import { Empty } from '@/components/common/Empty';
import {
@ -45,6 +46,10 @@ export function WebsiteSelect({
onChange(id);
};
const renderValue = () => {
return isCollapsed ? '' : name;
};
return (
<Select
{...props}
@ -55,11 +60,14 @@ export function WebsiteSelect({
onSearch={handleSearch}
onChange={handleChange}
onOpenChange={handleOpenChange}
renderValue={renderValue}
listProps={{
renderEmptyState: () => <Empty message={t(messages.noResultsFound)} />,
style: { maxHeight: 'calc(42vh - 65px)', width: 280 },
}}
buttonProps={{ style: { minHeight: 40 } }}
buttonProps={{
style: { minHeight: 40, gap: 0, justifyContent: isCollapsed ? 'start' : undefined },
}}
>
{listItems.map(({ id, name }) => (
<ListItem key={id} id={id}>