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