diff --git a/.umirc.ts b/.umirc.ts index bf170ae..c0f1e5d 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -1,6 +1,5 @@ import { defineConfig } from '@umijs/max'; import proxy from './config/proxy'; - const { REACT_APP_ENV = 'dev' } = process.env as { REACT_APP_ENV: 'dev' | 'test' | 'prod'; }; @@ -14,6 +13,7 @@ export default defineConfig({ locale: { default: 'vi-VN', }, + favicons: ['/logo.png'], layout: { title: '2025 Sản phẩm của Mobifone v1.0', }, diff --git a/public/avatar.svg b/public/avatar.svg new file mode 100644 index 0000000..48ac9e5 --- /dev/null +++ b/public/avatar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/app.tsx b/src/app.tsx index 4a18fc1..2543ebd 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,8 +1,9 @@ +import { LogoutOutlined } from '@ant-design/icons'; import { history, RunTimeLayoutConfig } from '@umijs/max'; +import { Dropdown } from 'antd'; import { handleRequestConfig } from '../config/Request'; import logo from '../public/logo.png'; import UnAccessPage from './components/403/403Page'; -import Footer from './components/Footer/Footer'; import { ROUTE_LOGIN } from './constants'; import { parseJwt } from './utils/jwtTokenUtils'; import { getToken, removeToken } from './utils/localStorageUtils'; @@ -72,12 +73,37 @@ export const layout: RunTimeLayoutConfig = (initialState) => { margin: 0, paddingInline: 0, }, + avatarProps: { + size: 'small', + src: '/avatar.svg', // 👈 ở đây dùng icon thay vì src + render: (_, dom) => { + return ( + , + label: 'Đăng xuất', + onClick: () => { + removeToken(); + history.push(ROUTE_LOGIN); + }, + }, + ], + }} + > + {dom} + + ); + }, + }, layout: 'mix', logout: () => { removeToken(); history.push(ROUTE_LOGIN); }, - footerRender: () =>