VORKOUT-8 #13
@ -2,6 +2,7 @@ import { Drawer } from 'antd';
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Avatar, Typography } from 'antd';
|
import { Avatar, Typography } from 'antd';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useUserSelector } from '@/store/userStore';
|
||||||
|
|
||||||
interface ContentDrawerProps {
|
interface ContentDrawerProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@ -22,6 +23,7 @@ export default function ContentDrawer({
|
|||||||
name,
|
name,
|
||||||
email,
|
email,
|
||||||
}: ContentDrawerProps) {
|
}: ContentDrawerProps) {
|
||||||
|
const user = useUserSelector();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [width, setWidth] = useState<number | string>('30%');
|
const [width, setWidth] = useState<number | string>('30%');
|
||||||
|
|
||||||
@ -36,6 +38,7 @@ export default function ContentDrawer({
|
|||||||
window.addEventListener('resize', calculateWidths);
|
window.addEventListener('resize', calculateWidths);
|
||||||
return () => window.removeEventListener('resize', calculateWidths);
|
return () => window.removeEventListener('resize', calculateWidths);
|
||||||
}, []);
|
}, []);
|
||||||
|
console.log(login, user?.login, login === user?.login);
|
||||||
|
|
||||||
const editDrawerTitle = (
|
const editDrawerTitle = (
|
||||||
<div
|
<div
|
||||||
@ -72,8 +75,11 @@ export default function ContentDrawer({
|
|||||||
style={{ flexShrink: 0 }}
|
style={{ flexShrink: 0 }}
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<Typography.Text strong style={{ display: 'block' }}>
|
<Typography.Text
|
||||||
{name}
|
strong
|
||||||
|
style={{ display: 'block', fontSize: '20px' }}
|
||||||
|
>
|
||||||
|
{name} {login === user?.login ? t('you') : ''}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
<Typography.Text type="secondary" style={{ fontSize: 14 }}>
|
<Typography.Text type="secondary" style={{ fontSize: 14 }}>
|
||||||
{email}
|
{email}
|
||||||
|
@ -49,6 +49,7 @@ i18n
|
|||||||
createdAt: 'Created',
|
createdAt: 'Created',
|
||||||
saving: 'Saving...',
|
saving: 'Saving...',
|
||||||
createdAccountMessage: 'User successfully created!',
|
createdAccountMessage: 'User successfully created!',
|
||||||
|
you: '(You)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
ru: {
|
ru: {
|
||||||
@ -89,7 +90,8 @@ i18n
|
|||||||
nameLogin: 'Имя, Логин',
|
nameLogin: 'Имя, Логин',
|
||||||
createdAt: 'Создано',
|
createdAt: 'Создано',
|
||||||
saving: 'Сохранение...',
|
saving: 'Сохранение...',
|
||||||
createdAccountMessage: 'Пользователь успешно создан!'
|
createdAccountMessage: 'Пользователь успешно создан!',
|
||||||
|
you: '(Вы)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -138,7 +138,10 @@ export default function AccountsPage() {
|
|||||||
|
|
||||||
const onTableChange: TableProps<AllUser>['onChange'] = (pagination) => {
|
const onTableChange: TableProps<AllUser>['onChange'] = (pagination) => {
|
||||||
console.log(pagination);
|
console.log(pagination);
|
||||||
UserService.getUsers(pagination.current as number, 10).then((data) => {
|
UserService.getUsers(
|
||||||
|
pagination.current as number,
|
||||||
|
pagination.pageSize
|
||||||
|
).then((data) => {
|
||||||
setAccounts(data);
|
setAccounts(data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user