add translate
This commit is contained in:
@@ -2,22 +2,27 @@ import NotificationsButton from './notificationsButton';
|
||||
import UserMenuButton from './userMenuButton';
|
||||
import Link from 'next/link';
|
||||
import LanguageSwitcher from '@/app/components/LanguageSwitcher';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
export default function HeaderPanel() {
|
||||
const t = useTranslations("Global");
|
||||
|
||||
return (
|
||||
<header className="header">
|
||||
<div className="header-action">
|
||||
<LanguageSwitcher/>
|
||||
<LanguageSwitcher />
|
||||
<Link
|
||||
href={'/pages/payment'}
|
||||
className="tokens-balance"
|
||||
>
|
||||
<div className="tokens-wrapper" title="Текущий баланс токенов для защиты файлов">
|
||||
<div className="tokens-wrapper" title={t('current-balance-of-protection')}>
|
||||
<svg viewBox="0 0 24 24" fill="currentColor" style={{ width: "16px", height: "16px" }}>
|
||||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4z"></path>
|
||||
</svg>
|
||||
<span className="tokens-count">800</span>
|
||||
<span className="tokens-label">токенов</span>
|
||||
<span className="tokens-label">
|
||||
{t('tokens')}
|
||||
</span>
|
||||
</div>
|
||||
</Link>
|
||||
<NotificationsButton />
|
||||
|
||||
@@ -6,10 +6,12 @@ import Link from 'next/link';
|
||||
import { getUserData } from '@/app/actions/action';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { logout } from '@/app/actions/auth';
|
||||
import { useTranslations } from 'next-intl';
|
||||
|
||||
export default function UserMenuButton() {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const menuRef = useRef<HTMLDivElement | null>(null);
|
||||
const t = useTranslations("Global");
|
||||
const {
|
||||
data: userData,
|
||||
isLoading,
|
||||
@@ -61,12 +63,12 @@ export default function UserMenuButton() {
|
||||
{userData?.email ? userData.email : ''}
|
||||
</div>
|
||||
<div className="user-subscription">
|
||||
<span className="text-[14px]">Тариф: </span>
|
||||
<span className="text-[14px]">{t('rate')}: </span>
|
||||
<span className="subscription-badge">
|
||||
{userData?.subscriptionType ? userData.subscriptionType : ''}
|
||||
</span>
|
||||
<br />
|
||||
<span className="user-subscription-expire">Истекает: 00.00.00</span>
|
||||
<span className="user-subscription-expire">{t('expires')}: 00.00.00</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,13 +78,13 @@ export default function UserMenuButton() {
|
||||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M19.14,12.94c0.04-0.3,0.06-0.61,0.06-0.94c0-0.32-0.02-0.64-0.07-0.94l2.03-1.58c0.18-0.14,0.23-0.41,0.12-0.61 l-1.92-3.32c-0.12-0.22-0.37-0.29-0.59-0.22l-2.39,0.96c-0.5-0.38-1.03-0.7-1.62-0.94L14.4,2.81c-0.04-0.24-0.24-0.41-0.48-0.41 h-3.84c-0.24,0-0.43,0.17-0.47,0.41L9.25,5.35C8.66,5.59,8.12,5.92,7.63,6.29L5.24,5.33c-0.22-0.08-0.47,0-0.59,0.22L2.74,8.87 C2.62,9.08,2.66,9.34,2.86,9.48l2.03,1.58C4.84,11.36,4.82,11.69,4.82,12s0.02,0.64,0.07,0.94l-2.03,1.58 c-0.18,0.14-0.23,0.41-0.12,0.61l1.92,3.32c0.12,0.22,0.37,0.29,0.59,0.22l2.39-0.96c0.5,0.38,1.03,0.7,1.62,0.94l0.36,2.54 c0.05,0.24,0.24,0.41,0.48,0.41h3.84c0.24,0,0.44-0.17,0.47-0.41l0.36-2.54c0.59-0.24,1.13-0.56,1.62-0.94l2.39,0.96 c0.22,0.08,0.47,0,0.59-0.22l1.92-3.32c0.12-0.22,0.07-0.47-0.12-0.61L19.14,12.94z M12,15.6c-1.98,0-3.6-1.62-3.6-3.6 s1.62-3.6,3.6-3.6s3.6,1.62,3.6,3.6S13.98,15.6,12,15.6z"></path>
|
||||
</svg>
|
||||
Настройки
|
||||
{t('settings')}
|
||||
</Link>
|
||||
<Link href="/pages/faq" className="user-menu-item">
|
||||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"></path>
|
||||
</svg>
|
||||
Помощь
|
||||
{t('help')}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -98,7 +100,7 @@ export default function UserMenuButton() {
|
||||
<svg viewBox="0 0 24 24" fill="currentColor">
|
||||
<path d="M17 7l-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z"></path>
|
||||
</svg>
|
||||
Выйти
|
||||
{t('exit')}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user