fix(nostr-feed): Use shadcn-vue Select for time range dropdown
Replace native HTML select with themed Select component for proper dark mode support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2c4af6c2b5
commit
5d44051898
1 changed files with 23 additions and 12 deletions
|
|
@ -6,6 +6,13 @@
|
||||||
|
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
import { Flame, Clock, TrendingUp, Swords } from 'lucide-vue-next'
|
import { Flame, Clock, TrendingUp, Swords } from 'lucide-vue-next'
|
||||||
|
import {
|
||||||
|
Select,
|
||||||
|
SelectContent,
|
||||||
|
SelectItem,
|
||||||
|
SelectTrigger,
|
||||||
|
SelectValue
|
||||||
|
} from '@/components/ui/select'
|
||||||
import type { SortType, TimeRange } from '../types/submission'
|
import type { SortType, TimeRange } from '../types/submission'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
|
@ -78,19 +85,23 @@ function selectTimeRange(range: TimeRange) {
|
||||||
<!-- Time range dropdown (for top) -->
|
<!-- Time range dropdown (for top) -->
|
||||||
<template v-if="showTimeDropdown">
|
<template v-if="showTimeDropdown">
|
||||||
<span class="text-muted-foreground mx-1">·</span>
|
<span class="text-muted-foreground mx-1">·</span>
|
||||||
<select
|
<Select
|
||||||
:value="currentTimeRange"
|
:model-value="currentTimeRange"
|
||||||
class="bg-transparent text-sm text-muted-foreground hover:text-foreground cursor-pointer border-none outline-none"
|
@update:model-value="selectTimeRange($event as TimeRange)"
|
||||||
@change="selectTimeRange(($event.target as HTMLSelectElement).value as TimeRange)"
|
|
||||||
>
|
>
|
||||||
<option
|
<SelectTrigger class="h-auto w-auto gap-1 border-0 bg-transparent px-1 py-0.5 text-sm text-muted-foreground shadow-none hover:text-foreground focus:ring-0">
|
||||||
v-for="range in timeRangeOptions"
|
<SelectValue />
|
||||||
:key="range.id"
|
</SelectTrigger>
|
||||||
:value="range.id"
|
<SelectContent>
|
||||||
>
|
<SelectItem
|
||||||
{{ range.label }}
|
v-for="range in timeRangeOptions"
|
||||||
</option>
|
:key="range.id"
|
||||||
</select>
|
:value="range.id"
|
||||||
|
>
|
||||||
|
{{ range.label }}
|
||||||
|
</SelectItem>
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue