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