add translate for notifications
This commit is contained in:
@@ -5175,7 +5175,8 @@
|
|||||||
&-text {
|
&-text {
|
||||||
color: v.$text-s;
|
color: v.$text-s;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
font-weight: 600;
|
font-weight: 800;
|
||||||
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-status {
|
&-status {
|
||||||
|
|||||||
@@ -11,12 +11,13 @@ import { useQueryClient } from '@tanstack/react-query';
|
|||||||
import { formatDate } from '@/app/lib/formatDate';
|
import { formatDate } from '@/app/lib/formatDate';
|
||||||
|
|
||||||
export default function NotificationsButton() {
|
export default function NotificationsButton() {
|
||||||
|
const t = useTranslations('Global');
|
||||||
|
const norificationTranslate = useTranslations('Notifications');
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const menuRef = useRef<HTMLDivElement | null>(null);
|
const menuRef = useRef<HTMLDivElement | null>(null);
|
||||||
const [loadingIds, setLoadingIds] = useState<Set<number>>(new Set());
|
const [loadingIds, setLoadingIds] = useState<Set<number>>(new Set());
|
||||||
const [isMarkingAll, setIsMarkingAll] = useState(false);
|
const [isMarkingAll, setIsMarkingAll] = useState(false);
|
||||||
const t = useTranslations('Global');
|
|
||||||
|
|
||||||
const { data: notificationList } = useActiveNotifications();
|
const { data: notificationList } = useActiveNotifications();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
@@ -134,7 +135,7 @@ export default function NotificationsButton() {
|
|||||||
</div> */}
|
</div> */}
|
||||||
|
|
||||||
<div className="notification-text">
|
<div className="notification-text">
|
||||||
{item.message}
|
{norificationTranslate.has(item.message) ? norificationTranslate(item.message): item.message}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { formatDate, formatDateTime } from '@/app/lib/formatDate';
|
|||||||
|
|
||||||
export function NotificationsList() {
|
export function NotificationsList() {
|
||||||
const t = useTranslations('Global');
|
const t = useTranslations('Global');
|
||||||
|
const norificationTranslate = useTranslations('Notifications');
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const [selectedFiles, setSelectedFiles] = useState<Set<number>>(new Set());
|
const [selectedFiles, setSelectedFiles] = useState<Set<number>>(new Set());
|
||||||
@@ -170,6 +171,7 @@ export function NotificationsList() {
|
|||||||
>
|
>
|
||||||
{(allNotifications?.notifications.length !== 0) && (
|
{(allNotifications?.notifications.length !== 0) && (
|
||||||
allNotifications?.notifications.map(item => {
|
allNotifications?.notifications.map(item => {
|
||||||
|
console.log(item);
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`notification-item ${loadingIds.has(item.id) ? 'loading' : ''} ${item.status}`}
|
className={`notification-item ${loadingIds.has(item.id) ? 'loading' : ''} ${item.status}`}
|
||||||
@@ -195,11 +197,11 @@ export function NotificationsList() {
|
|||||||
<div
|
<div
|
||||||
className="notification-header"
|
className="notification-header"
|
||||||
>
|
>
|
||||||
<div
|
{/* <div
|
||||||
className="notification-title"
|
className="notification-title"
|
||||||
>
|
>
|
||||||
{item.type} {item.id}
|
{item.type} {item.id}
|
||||||
</div>
|
</div> */}
|
||||||
{/* <div
|
{/* <div
|
||||||
className="notification-status"
|
className="notification-status"
|
||||||
>
|
>
|
||||||
@@ -209,7 +211,7 @@ export function NotificationsList() {
|
|||||||
<div
|
<div
|
||||||
className="notification-text"
|
className="notification-text"
|
||||||
>
|
>
|
||||||
{item.message}
|
{norificationTranslate.has(item.message) ? norificationTranslate(item.message): item.message}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="notification-footer"
|
className="notification-footer"
|
||||||
|
|||||||
Reference in New Issue
Block a user