add user status translate + fix notification count-icon size while long numbers
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "no-copy-frontend",
|
"name": "no-copy-frontend",
|
||||||
"version": "0.93.0",
|
"version": "0.94.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev -p 2999",
|
"dev": "next dev -p 2999",
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export interface UserData {
|
|||||||
tariffs: Tariff[];
|
tariffs: Tariff[];
|
||||||
tariffInfo: TariffInfo;
|
tariffInfo: TariffInfo;
|
||||||
permission: number;
|
permission: number;
|
||||||
verifiedStatus?: string;
|
verifiedStatus?: 'unknow' | 'NOT_VERIFIED' | 'VERIFICATION_IN_PROGRESS' | 'VERIFIED' | 'VERIFICATION_FAILED';
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useUserProfile = () => {
|
export const useUserProfile = () => {
|
||||||
|
|||||||
@@ -279,6 +279,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
padding-top: 1px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,21 @@ export default function NotificationsButton() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getFontSizeByCount = (count: number | undefined) => {
|
||||||
|
if (!count) return '12px';
|
||||||
|
|
||||||
|
const countStr = String(count);
|
||||||
|
|
||||||
|
switch (countStr.length) {
|
||||||
|
case 3:
|
||||||
|
return '10px';
|
||||||
|
case 4:
|
||||||
|
return '8px';
|
||||||
|
default:
|
||||||
|
return '12px';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="notification-wrapper" ref={menuRef}>
|
<div className="notification-wrapper" ref={menuRef}>
|
||||||
<button
|
<button
|
||||||
@@ -135,6 +150,7 @@ export default function NotificationsButton() {
|
|||||||
{notificationList?.unreadCount !== 0 && (
|
{notificationList?.unreadCount !== 0 && (
|
||||||
<span
|
<span
|
||||||
className="notification-unread-count"
|
className="notification-unread-count"
|
||||||
|
style={{ fontSize: getFontSizeByCount(notificationList?.unreadCount) }}
|
||||||
>
|
>
|
||||||
{notificationList?.unreadCount ? notificationList?.unreadCount : ''}
|
{notificationList?.unreadCount ? notificationList?.unreadCount : ''}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -6,16 +6,36 @@ import VerificationUploadSection from '@/app/ui/settings/component/verification-
|
|||||||
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
||||||
|
|
||||||
export default function SettingUserVerification() {
|
export default function SettingUserVerification() {
|
||||||
const t = useTranslations('Global');
|
const t = useTranslations('User-status');
|
||||||
|
|
||||||
const { data: allFilesExtensions } = useAllFilesExtensions();
|
const { data: allFilesExtensions } = useAllFilesExtensions();
|
||||||
const { data: userData, isLoading, isError } = useUserProfile();
|
const { data: userData, isLoading, isError } = useUserProfile();
|
||||||
|
|
||||||
|
const getVerifiedStatusText = (status: string | undefined | null) => {
|
||||||
|
switch (status) {
|
||||||
|
case 'VERIFICATION_IN_PROGRESS':
|
||||||
|
return t('under-moderation');
|
||||||
|
case 'NOT_VERIFIED':
|
||||||
|
return t('NOT_VERIFIED');
|
||||||
|
case 'VERIFIED':
|
||||||
|
return t('VERIFIED');
|
||||||
|
case 'VERIFICATION_FAILED':
|
||||||
|
return t('VERIFICATION_FAILED');
|
||||||
|
case 'unknow':
|
||||||
|
return t('unknow');
|
||||||
|
case undefined:
|
||||||
|
case null:
|
||||||
|
return t('NOT_VERIFIED');
|
||||||
|
default:
|
||||||
|
return t('NOT_VERIFIED');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="settings-form">
|
<div className="settings-form">
|
||||||
<div className="form-section verefication-section">
|
<div className="form-section verefication-section">
|
||||||
<h3 className="form-section-title">
|
<h3 className="form-section-title">
|
||||||
Верификация юзера
|
{t('user-verification')}
|
||||||
</h3>
|
</h3>
|
||||||
{userData?.verifiedStatus === 'NOT_VERIFIED' || userData?.verifiedStatus === null ? (
|
{userData?.verifiedStatus === 'NOT_VERIFIED' || userData?.verifiedStatus === null ? (
|
||||||
<VerificationUploadSection
|
<VerificationUploadSection
|
||||||
@@ -25,12 +45,9 @@ export default function SettingUserVerification() {
|
|||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<span>
|
<span>
|
||||||
{t('Status')}: {userData?.verifiedStatus === 'VERIFICATION_IN_PROGRESS'? t('under-moderation') : userData?.verifiedStatus}
|
{t('Status')}: {getVerifiedStatusText(userData?.verifiedStatus)}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{/* <button type="submit" className="btn btn-primary">
|
|
||||||
загрузить
|
|
||||||
</button> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -422,7 +422,6 @@
|
|||||||
"protected-files": "Protected files",
|
"protected-files": "Protected files",
|
||||||
"storage": "Storage",
|
"storage": "Storage",
|
||||||
"Status": "Status",
|
"Status": "Status",
|
||||||
"under-moderation": "Under moderation",
|
|
||||||
"full-link": "Full link",
|
"full-link": "Full link",
|
||||||
"follow-the-link": "Follow the link",
|
"follow-the-link": "Follow the link",
|
||||||
"date-of-discovery": "Date of discovery",
|
"date-of-discovery": "Date of discovery",
|
||||||
@@ -570,5 +569,14 @@
|
|||||||
"notification-file-moderation": "File moderation event",
|
"notification-file-moderation": "File moderation event",
|
||||||
"notification-file-added": "File added to system",
|
"notification-file-added": "File added to system",
|
||||||
"notification-search-operation-filed": "Search operation failed"
|
"notification-search-operation-filed": "Search operation failed"
|
||||||
|
},
|
||||||
|
"User-status": {
|
||||||
|
"under-moderation": "Under moderation",
|
||||||
|
"NOT_VERIFIED": "Not verified",
|
||||||
|
"VERIFIED": "Verified",
|
||||||
|
"VERIFICATION_FAILED": "Verification failed",
|
||||||
|
"unknow": "Unknown",
|
||||||
|
"user-verification": "User verification",
|
||||||
|
"Status": "Status"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -422,7 +422,6 @@
|
|||||||
"protected-files": "Защищено файлов",
|
"protected-files": "Защищено файлов",
|
||||||
"storage": "Хранилище",
|
"storage": "Хранилище",
|
||||||
"Status": "Статус",
|
"Status": "Статус",
|
||||||
"under-moderation": "На модерации",
|
|
||||||
"full-link": "Полная ссылка",
|
"full-link": "Полная ссылка",
|
||||||
"follow-the-link": "Перейти",
|
"follow-the-link": "Перейти",
|
||||||
"date-of-discovery": "Дата обнаружения",
|
"date-of-discovery": "Дата обнаружения",
|
||||||
@@ -570,5 +569,14 @@
|
|||||||
"notification-file-moderation": "Модерация файла",
|
"notification-file-moderation": "Модерация файла",
|
||||||
"notification-file-added": "Файл добавлен в систему",
|
"notification-file-added": "Файл добавлен в систему",
|
||||||
"notification-search-operation-filed": "Ошибка операции поиска"
|
"notification-search-operation-filed": "Ошибка операции поиска"
|
||||||
|
},
|
||||||
|
"User-status": {
|
||||||
|
"under-moderation": "На модерации",
|
||||||
|
"NOT_VERIFIED": "Не верифицирован",
|
||||||
|
"VERIFIED": "Верифицирован",
|
||||||
|
"VERIFICATION_FAILED": "Верификация не удалась",
|
||||||
|
"unknow": "Неизвестно",
|
||||||
|
"user-verification": "Верификация юзера",
|
||||||
|
"Status": "Статус"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user