From 016da9f638ca4a7ecec35e0d77c0e851bc3b8808 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Tue, 2 Jun 2026 16:17:10 +0300 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20=D0=B2=D1=81=D0=B5=20=D0=BD=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D0=B2=D0=BD=D1=8B=D0=B5=20date-=D0=B8=D0=BD=D0=BF=D1=83?= =?UTF-8?q?=D1=82=D1=8B=20=D0=BD=D0=B0=20DateField?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Тёмный DateField теперь везде, где был браузерный : фильтр периода в Трафике, диапазон дат в Платежах и Аудит-логе, срок действия промокода. Единый вид во всём кабинете. (datetime-local не трогал — там нужно ещё и время.) --- .../trafficUsage/filters/PeriodSelector.tsx | 13 +++++-------- src/pages/AdminAuditLog.tsx | 19 +++++++++---------- src/pages/AdminPayments.tsx | 17 +++++++++-------- src/pages/AdminPromocodeCreate.tsx | 9 ++++----- 4 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/components/admin/trafficUsage/filters/PeriodSelector.tsx b/src/components/admin/trafficUsage/filters/PeriodSelector.tsx index da00ca9..9d020fe 100644 --- a/src/components/admin/trafficUsage/filters/PeriodSelector.tsx +++ b/src/components/admin/trafficUsage/filters/PeriodSelector.tsx @@ -1,5 +1,6 @@ import { useTranslation } from 'react-i18next'; import { CalendarIcon, XIcon } from '../TrafficIcons'; +import { DateField } from '../../../DateField'; // ────────────────────────────────────────────────────────────────── // PeriodSelector — switches between fixed period tabs (1/3/7/14/30 @@ -44,22 +45,18 @@ export function PeriodSelector({
{t('admin.trafficUsage.dateFrom')} - onCustomStartChange(e.target.value)} - className="rounded-lg border border-dark-700 bg-dark-800 px-2 py-1 text-xs text-dark-200 focus:border-dark-600 focus:outline-none" + onChange={onCustomStartChange} /> {t('admin.trafficUsage.dateTo')} - onCustomEndChange(e.target.value)} - className="rounded-lg border border-dark-700 bg-dark-800 px-2 py-1 text-xs text-dark-200 focus:border-dark-600 focus:outline-none" + onChange={onCustomEndChange} />
@@ -721,12 +721,11 @@ export default function AdminAuditLog() { > {t('admin.auditLog.filters.dateTo')} - setFilters((prev) => ({ ...prev, dateTo: e.target.value }))} - className="w-full rounded-lg border border-dark-600 bg-dark-900 px-3 py-2 text-sm text-dark-100 outline-none transition-colors focus:border-accent-500" + min={filters.dateFrom} + onChange={(v) => setFilters((prev) => ({ ...prev, dateTo: v }))} + className="flex w-full items-center gap-2 rounded-lg border border-dark-600 bg-dark-900 px-3 py-2 text-sm text-dark-100 transition-colors hover:border-accent-500" /> diff --git a/src/pages/AdminPayments.tsx b/src/pages/AdminPayments.tsx index 76daaab..e35f6c2 100644 --- a/src/pages/AdminPayments.tsx +++ b/src/pages/AdminPayments.tsx @@ -3,6 +3,7 @@ import { useNavigate } from 'react-router'; import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; import { useTranslation } from 'react-i18next'; import { adminPaymentsApi, type SearchStats } from '../api/adminPayments'; +import { DateField } from '../components/DateField'; import { useCurrency } from '../hooks/useCurrency'; import type { PendingPayment, PaginatedResponse } from '../types'; import { usePlatform } from '../platform/hooks/usePlatform'; @@ -327,20 +328,20 @@ export default function AdminPayments() { - setDateFrom(e.target.value)} - className="w-full rounded-lg border border-dark-700 bg-dark-800 px-3 py-2 text-sm text-dark-100 focus:border-accent-500 focus:outline-none" + max={dateTo} + onChange={setDateFrom} + className="flex w-full items-center gap-2 rounded-lg border border-dark-700 bg-dark-800 px-3 py-2 text-sm text-dark-100 transition-colors hover:border-accent-500" />
- setDateTo(e.target.value)} - className="w-full rounded-lg border border-dark-700 bg-dark-800 px-3 py-2 text-sm text-dark-100 focus:border-accent-500 focus:outline-none" + min={dateFrom} + onChange={setDateTo} + className="flex w-full items-center gap-2 rounded-lg border border-dark-700 bg-dark-800 px-3 py-2 text-sm text-dark-100 transition-colors hover:border-accent-500" />