Skip to content

Commit 0920513

Browse files
committed
Inline the filter options.
1 parent dc9845d commit 0920513

File tree

1 file changed

+36
-46
lines changed

1 file changed

+36
-46
lines changed

browser-extension/tests/playground/claude.tsx

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -528,16 +528,8 @@ export const ClaudePrototype = () => {
528528
className='w-full pl-9 pr-3 py-1.5 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500'
529529
/>
530530
</div>
531-
<button
532-
type='button'
533-
onClick={() => setShowFilters(!showFilters)}
534-
className={`p-1.5 hover:bg-gray-100 rounded ${showFilters ? 'bg-gray-100' : ''}`}
535-
title='Filter options'
536-
>
537-
<Filter className='w-4 h-4 text-gray-600' />
538-
</button>
531+
{filterControls(filters, updateFilter)}
539532
</div>
540-
{showFilters && filterControls(filters, updateFilter)}
541533
</div>
542534
</th>
543535
</tr>
@@ -557,44 +549,42 @@ function filterControls(
557549
updateFilter: <K extends keyof FilterState>(key: K, value: FilterState[K]) => void,
558550
) {
559551
return (
560-
<div className='absolute top-full right-0 mt-1 p-3 bg-white border border-gray-300 rounded-md shadow-lg z-10 min-w-48'>
561-
<div className='space-y-1'>
562-
<div className='relative flex overflow-hidden'>
563-
<Badge
564-
type='archived'
565-
text='show archived'
566-
selected={filters.showArchived}
567-
onClick={() => updateFilter('showArchived', true)}
568-
/>
569-
<Badge
570-
type='hideArchived'
571-
text='hide archived'
572-
selected={!filters.showArchived}
573-
onClick={() => updateFilter('showArchived', false)}
574-
/>
575-
</div>
576-
<div className='relative flex overflow-hidden'>
577-
<Badge
578-
type='unsent'
579-
text='unsent only'
580-
selected={filters.sentFilter === 'unsent'}
581-
onClick={() => updateFilter('sentFilter', 'unsent')}
582-
/>
583-
<Badge
584-
type='blank'
585-
text='both'
586-
selected={filters.sentFilter === 'all'}
587-
onClick={() => updateFilter('sentFilter', 'all')}
588-
/>
589-
<Badge
590-
type='sent'
591-
text='sent only'
592-
selected={filters.sentFilter === 'sent'}
593-
onClick={() => updateFilter('sentFilter', 'sent')}
594-
/>
595-
</div>
552+
<>
553+
<div className='relative flex overflow-hidden'>
554+
<Badge
555+
type='archived'
556+
text='show archived'
557+
selected={filters.showArchived}
558+
onClick={() => updateFilter('showArchived', true)}
559+
/>
560+
<Badge
561+
type='hideArchived'
562+
text='hide archived'
563+
selected={!filters.showArchived}
564+
onClick={() => updateFilter('showArchived', false)}
565+
/>
596566
</div>
597-
</div>
567+
<div className='relative flex overflow-hidden'>
568+
<Badge
569+
type='unsent'
570+
text='unsent only'
571+
selected={filters.sentFilter === 'unsent'}
572+
onClick={() => updateFilter('sentFilter', 'unsent')}
573+
/>
574+
<Badge
575+
type='blank'
576+
text='both'
577+
selected={filters.sentFilter === 'all'}
578+
onClick={() => updateFilter('sentFilter', 'all')}
579+
/>
580+
<Badge
581+
type='sent'
582+
text='sent only'
583+
selected={filters.sentFilter === 'sent'}
584+
onClick={() => updateFilter('sentFilter', 'sent')}
585+
/>
586+
</div>
587+
</>
598588
)
599589
}
600590

0 commit comments

Comments
 (0)