From 169d0d33a0f54f4206e4359406e4dceb567e8d3b Mon Sep 17 00:00:00 2001 From: smanylov Date: Tue, 16 Dec 2025 20:26:17 +0700 Subject: [PATCH] update translate and styles --- src/app/[locale]/pages/marking-audio/page.tsx | 5 +- src/app/[locale]/pages/marking-photo/page.tsx | 4 +- src/app/[locale]/pages/marking-video/page.tsx | 4 +- src/app/[locale]/pages/settings/page.tsx | 19 +++-- src/app/components/StackedBarChart.tsx | 9 +- src/app/components/dropDownList.tsx | 4 +- src/app/components/tanstakTable.tsx | 82 ++++++++++--------- src/app/styles/global-styles.scss | 14 ++++ .../ui/marking-page/protection-summary.tsx | 21 ++++- .../ui/settings/personal-data-settings.tsx | 53 ++++++++---- src/i18n/messages/en.json | 17 +++- src/i18n/messages/ru.json | 17 +++- 12 files changed, 171 insertions(+), 78 deletions(-) diff --git a/src/app/[locale]/pages/marking-audio/page.tsx b/src/app/[locale]/pages/marking-audio/page.tsx index 8fcfa94..9d86497 100644 --- a/src/app/[locale]/pages/marking-audio/page.tsx +++ b/src/app/[locale]/pages/marking-audio/page.tsx @@ -1,7 +1,6 @@ -import ProtectedFilesTable from '@/app/ui/marking-page/protected-files-table'; import ProtectionSummary from '@/app/ui/marking-page/protection-summary'; import TestSection from '@/app/ui/marking-page/test-section'; -import { IconAudioFile } from '@/app/ui/icons/icons'; +import FilesTable from '@/app/ui/dashboard/files-table'; export default function Page() { return ( @@ -11,7 +10,7 @@ export default function Page() { - + ) } \ No newline at end of file diff --git a/src/app/[locale]/pages/marking-photo/page.tsx b/src/app/[locale]/pages/marking-photo/page.tsx index 3d23083..ddd637e 100644 --- a/src/app/[locale]/pages/marking-photo/page.tsx +++ b/src/app/[locale]/pages/marking-photo/page.tsx @@ -2,8 +2,8 @@ import ProtectedFilesTable from '@/app/ui/marking-page/protected-files-table'; import ProtectionSummary from '@/app/ui/marking-page/protection-summary'; import TestSection from '@/app/ui/marking-page/test-section'; import UploadSectionImage from '@/app/ui/marking-page/upload-section-image'; -import TanstakFilesTable from '@/app/components/tanstakTable'; import { useTranslations } from 'next-intl'; +import FilesTable from '@/app/ui/dashboard/files-table'; export default function Page() { const t = useTranslations('Global'); @@ -17,7 +17,7 @@ export default function Page() { - + {/* */} ) diff --git a/src/app/[locale]/pages/marking-video/page.tsx b/src/app/[locale]/pages/marking-video/page.tsx index 53fcd68..9d9254e 100644 --- a/src/app/[locale]/pages/marking-video/page.tsx +++ b/src/app/[locale]/pages/marking-video/page.tsx @@ -1,7 +1,7 @@ -import ProtectedFilesTable from '@/app/ui/marking-page/protected-files-table'; import ProtectionSummary from '@/app/ui/marking-page/protection-summary'; import TestSection from '@/app/ui/marking-page/test-section'; import UploadSectionVideo from '@/app/ui/marking-page/upload-section-video'; +import FilesTable from '@/app/ui/dashboard/files-table'; export default function Page() { @@ -13,7 +13,7 @@ export default function Page() { - + ) } \ No newline at end of file diff --git a/src/app/[locale]/pages/settings/page.tsx b/src/app/[locale]/pages/settings/page.tsx index 2143810..fa7f71b 100644 --- a/src/app/[locale]/pages/settings/page.tsx +++ b/src/app/[locale]/pages/settings/page.tsx @@ -5,20 +5,25 @@ import SubscriptionSettings from '@/app/ui/settings/subscription-settings'; import APISettings from '@/app/ui/settings/api-settings'; import LastActivitySettings from '@/app/ui/settings/last-activity-settings'; import DangerZone from '@/app/ui/settings/danger-zone'; +import { useTranslations } from 'next-intl'; export default function Page() { + const t = useTranslations('Global'); + return ( <> -

⚙️ Настройки аккаунта

+

+ {t('account-settings')} +

- - - - - + + + + +
- + ) } \ No newline at end of file diff --git a/src/app/components/StackedBarChart.tsx b/src/app/components/StackedBarChart.tsx index c4ba70f..71f8e24 100644 --- a/src/app/components/StackedBarChart.tsx +++ b/src/app/components/StackedBarChart.tsx @@ -32,7 +32,7 @@ export const StackedBarChart = ({ data }: Files) => { const mainColors = ['#0088FE20', '#00C49F20', '#FFBB2820', '#FF804220', '#FF000020', '#FFC0CB20']; const secondColors = ['#0088FE', '#00C49F', '#FFBB28', '#FF8042', 'red', 'pink']; - const strokeColor = "#fff"; + const strokeColor = "#bfbdbdd1"; const strokeWidth = 1; const renderBarWithPartialBorder = (props: BarShapeProps) => { @@ -163,7 +163,7 @@ export const StackedBarChart = ({ data }: Files) => { return ( { {data.map((_entry, index) => ( @@ -192,7 +193,7 @@ export const StackedBarChart = ({ data }: Files) => { {data.map((_entry, index) => ( diff --git a/src/app/components/dropDownList.tsx b/src/app/components/dropDownList.tsx index c992e02..098c212 100644 --- a/src/app/components/dropDownList.tsx +++ b/src/app/components/dropDownList.tsx @@ -43,7 +43,7 @@ export default function DropDownList({ children, value, callBack }: DropDownList onClick={() => { setIsOpen(!isOpen) }} - className="flex items-center justify-between w-full px-4 py-2 text-sm font-medium bg-white border-2 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#6365f186]" + className="flex items-center justify-between w-full px-4 py-2 text-sm font-medium bg-white border-2 border-[#d1cece] rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-[#6365f186]" > @@ -64,7 +64,7 @@ export default function DropDownList({ children, value, callBack }: DropDownList {isOpen && ( -
+
    {/* Таблица */} -
    - - - {table.getHeaderGroups().map(headerGroup => ( - - {headerGroup.headers.map(header => ( - - ))} - - ))} - - - {table.getRowModel().rows.length > 0 ? ( - table.getRowModel().rows.map(row => ( - - {row.getVisibleCells().map(cell => ( - +
    +
    +
    - {header.isPlaceholder - ? null - : typeof header.column.columnDef.header === 'function' - ? header.column.columnDef.header(header.getContext()) - : header.column.columnDef.header as string} -
    - {typeof cell.column.columnDef.cell === 'function' - ? cell.column.columnDef.cell(cell.getContext()) - : cell.getValue() as string} -
    + + {table.getHeaderGroups().map(headerGroup => ( + + {headerGroup.headers.map(header => ( + ))} - )) - ) : ( - - - - )} - -
    + {header.isPlaceholder + ? null + : typeof header.column.columnDef.header === 'function' + ? header.column.columnDef.header(header.getContext()) + : header.column.columnDef.header as string} +
    - {t('no-data-for-selected-filters')} -
    + ))} + + + {table.getRowModel().rows.length > 0 ? ( + table.getRowModel().rows.map(row => ( + + {row.getVisibleCells().map(cell => ( + + {typeof cell.column.columnDef.cell === 'function' + ? cell.column.columnDef.cell(cell.getContext()) + : cell.getValue() as string} + + ))} + + )) + ) : ( + + + {t('no-data-for-selected-filters')} + + + )} + + +
{/* Пагинация */} diff --git a/src/app/styles/global-styles.scss b/src/app/styles/global-styles.scss index 2828092..2cb73d0 100644 --- a/src/app/styles/global-styles.scss +++ b/src/app/styles/global-styles.scss @@ -112,4 +112,18 @@ color: black; } } +} + +@media (max-width: 1300px) { + .tanstak-file-table { + max-width: 800px; + margin: 0 auto; + } +} + +@media (max-width: 1200px) { + .tanstak-file-table { + max-width: 500px; + margin: 0 auto; + } } \ No newline at end of file diff --git a/src/app/ui/marking-page/protection-summary.tsx b/src/app/ui/marking-page/protection-summary.tsx index 8bda875..757366e 100644 --- a/src/app/ui/marking-page/protection-summary.tsx +++ b/src/app/ui/marking-page/protection-summary.tsx @@ -52,8 +52,25 @@ export default function ProtectionSummary() {
-
0
-
{t('size')}
+ {isOpen ? ( + <> +
0
+
+ {t('size')} +
+ + ) : + <> +
+
0
+
{t('check')}
+
+
+
0
+
{t('violations')}
+
+ + }
{isOpen ? (
diff --git a/src/app/ui/settings/personal-data-settings.tsx b/src/app/ui/settings/personal-data-settings.tsx index fb659c4..61128e8 100644 --- a/src/app/ui/settings/personal-data-settings.tsx +++ b/src/app/ui/settings/personal-data-settings.tsx @@ -1,5 +1,6 @@ 'use client' +import { useTranslations } from 'next-intl'; import { useActionState, useState } from 'react' export default function PersonalDataSettings() { @@ -12,58 +13,82 @@ export default function PersonalDataSettings() { const [selectedValue, setSelectedValue] = useState('male'); + const t = useTranslations('Global'); + return (
-

👤 Персональные данные

+

+ {t('personal-data')} +

- +
- +
- + - Email нельзя изменить. Обратитесь в поддержку. + {t('email-cant-change')}
- +
- +
- + - Используется для отправки поздравления + {t('used-to-send-congratulations')}
- + - Заполняется автоматически исходя из даты рождения + {t('automatically-filled-in-based-on-date-of-birth')}
- +
diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 82831e7..66a94c1 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -54,7 +54,22 @@ "date-filter": "Date filter", "type-filter": "Type filter", "items-per-page": "Items per page", - "image-protection": "Защита изображений" + "email": "Email", + "image-protection": "Защита изображений", + "account-settings": "Account settings", + "personal-data": "Personal data", + "full-name": "Full name", + "company": "Company", + "email-cant-change": "Email address cannot be changed. Please contact support.", + "phone": "Phone", + "gender": "Gender", + "birthday": "Birthday", + "age": "Age", + "male": "Male", + "female": "Female", + "used-to-send-congratulations": "Used to send congratulations", + "automatically-filled-in-based-on-date-of-birth": "Automatically filled in based on date of birth", + "save-changes": "Save changes" }, "Login-register-form": { "and": "and", diff --git a/src/i18n/messages/ru.json b/src/i18n/messages/ru.json index 041ad37..2ddde03 100644 --- a/src/i18n/messages/ru.json +++ b/src/i18n/messages/ru.json @@ -54,7 +54,22 @@ "date-filter": "Фильтр по дате", "type-filter": "Фильтр по типу", "items-per-page": "Записей на странице", - "image-protection": "Защита изображений" + "email": "Почта", + "image-protection": "Защита изображений", + "account-settings": "Настройки аккаунта", + "personal-data": "Персональные данные", + "full-name": "Полное имя", + "company": "Компания", + "email-cant-change": "Email нельзя изменить. Обратитесь в поддержку.", + "phone": "Телефон", + "gender": "Пол", + "birthday": "День рождения", + "age": "Возраст", + "male": "Мужской", + "female": "Женский", + "used-to-send-congratulations": "Используется для отправки поздравления", + "automatically-filled-in-based-on-date-of-birth": "Заполняется автоматически исходя из даты рождения", + "save-changes": "Сохранить изменения" }, "Login-register-form": { "and": "и",