fix(admin-dashboard): polish filters and date pickers
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
|||||||
BarChart3,
|
BarChart3,
|
||||||
BookOpen,
|
BookOpen,
|
||||||
CalendarDays,
|
CalendarDays,
|
||||||
|
Eraser,
|
||||||
GraduationCap,
|
GraduationCap,
|
||||||
Heart,
|
Heart,
|
||||||
LibraryBig,
|
LibraryBig,
|
||||||
@@ -201,6 +202,7 @@ function DateRangeFilter({
|
|||||||
onChange={(next) => onChange({ ...value, from: toApiDate(next instanceof DateObject ? next : null) })}
|
onChange={(next) => onChange({ ...value, from: toApiDate(next instanceof DateObject ? next : null) })}
|
||||||
calendar={persian}
|
calendar={persian}
|
||||||
locale={persian_fa}
|
locale={persian_fa}
|
||||||
|
onOpenPickNewDate={false}
|
||||||
calendarPosition="bottom-right"
|
calendarPosition="bottom-right"
|
||||||
inputClass="h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-right ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
inputClass="h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-right ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
||||||
placeholder="تاریخ شروع"
|
placeholder="تاریخ شروع"
|
||||||
@@ -214,6 +216,7 @@ function DateRangeFilter({
|
|||||||
onChange={(next) => onChange({ ...value, to: toApiDate(next instanceof DateObject ? next : null) })}
|
onChange={(next) => onChange({ ...value, to: toApiDate(next instanceof DateObject ? next : null) })}
|
||||||
calendar={persian}
|
calendar={persian}
|
||||||
locale={persian_fa}
|
locale={persian_fa}
|
||||||
|
onOpenPickNewDate={false}
|
||||||
calendarPosition="bottom-right"
|
calendarPosition="bottom-right"
|
||||||
inputClass="h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-right ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
inputClass="h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-right ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
||||||
placeholder="تاریخ پایان"
|
placeholder="تاریخ پایان"
|
||||||
@@ -221,7 +224,8 @@ function DateRangeFilter({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-end">
|
<div className="flex items-end">
|
||||||
<Button variant="outline" className="w-full md:w-auto" onClick={onReset}>
|
<Button variant="destructive" className="w-full gap-2 md:w-auto" onClick={onReset}>
|
||||||
|
<Eraser className="h-4 w-4" />
|
||||||
پاککردن
|
پاککردن
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -758,8 +762,8 @@ function EventsSection() {
|
|||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<FilterCard title="فیلتر رویدادها" description="این فیلتر فقط روی آمار رویداد، ثبتنام، درآمد و تنوع شرکتکنندگان اعمال میشود.">
|
<FilterCard title="فیلتر رویدادها" description="این فیلتر فقط روی آمار رویداد، ثبتنام، درآمد و تنوع شرکتکنندگان اعمال میشود.">
|
||||||
<div className="grid gap-3 xl:grid-cols-[1fr_1fr_1.2fr_auto]">
|
<div className="grid gap-3 xl:grid-cols-[2fr_1.2fr]">
|
||||||
<div className="xl:col-span-2">
|
<div>
|
||||||
<DateRangeFilter
|
<DateRangeFilter
|
||||||
value={filters}
|
value={filters}
|
||||||
onChange={(next) => setFilters((current) => ({ ...current, ...next }))}
|
onChange={(next) => setFilters((current) => ({ ...current, ...next }))}
|
||||||
@@ -786,11 +790,6 @@ function EventsSection() {
|
|||||||
emptyText="رویدادی پیدا نشد."
|
emptyText="رویدادی پیدا نشد."
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="hidden items-end xl:flex">
|
|
||||||
<Button variant="outline" onClick={reset}>
|
|
||||||
پاککردن
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</FilterCard>
|
</FilterCard>
|
||||||
{query.isLoading ? <SectionLoading /> : null}
|
{query.isLoading ? <SectionLoading /> : null}
|
||||||
|
|||||||
Reference in New Issue
Block a user