diff --git a/src/_mock/utils.js b/src/_mock/utils.js new file mode 100644 index 00000000..e69de29b diff --git a/src/pages/management/user/profile.tsx b/src/pages/management/user/profile.tsx deleted file mode 100644 index fc3c749b..00000000 --- a/src/pages/management/user/profile.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Avatar } from 'antd'; - -import CoverImage from '@/assets/images/cover/profile-banner.png'; -import Card from '@/components/card'; -import { useUserInfo } from '@/store/userStore'; - -function UserProfile() { - const { avatar } = useUserInfo(); - return ( - - - - - ); -} - -export default UserProfile; diff --git a/src/pages/management/user/profile/connections-tab.tsx b/src/pages/management/user/profile/connections-tab.tsx new file mode 100644 index 00000000..bbb6d78c --- /dev/null +++ b/src/pages/management/user/profile/connections-tab.tsx @@ -0,0 +1,3 @@ +export default function ConnectionsTab() { + return '4'; +} diff --git a/src/pages/management/user/profile/index.tsx b/src/pages/management/user/profile/index.tsx new file mode 100644 index 00000000..5059df80 --- /dev/null +++ b/src/pages/management/user/profile/index.tsx @@ -0,0 +1,88 @@ +import { CSSProperties, useState } from 'react'; + +import CoverImage from '@/assets/images/cover/cover_4.jpg'; +import Card from '@/components/card'; +import { Iconify } from '@/components/icon'; +import { useUserInfo } from '@/store/userStore'; +import { useThemeToken } from '@/theme/hooks'; + +import ConnectionsTab from './connections-tab'; +import ProfileTab from './profile-tab'; +import ProjectsTab from './projects-tab'; +import TeamsTab from './teams-tab'; + +function UserProfile() { + const { avatar, username } = useUserInfo(); + const { colorTextBase } = useThemeToken(); + const [currentTabIndex, setcurrentTabIndex] = useState(0); + + const bgStyle: CSSProperties = { + background: `linear-gradient(rgba(0, 75, 80, 0.8), rgba(0, 75, 80, 0.8)) center center / cover no-repeat, url(${CoverImage})`, + backgroundRepeat: 'no-repeat', + backgroundPosition: 'center center', + }; + + const tabs = [ + { + icon: , + title: 'Profile', + content: , + }, + { + icon: , + title: 'Teams', + content: , + }, + { + icon: , + title: 'Projects', + content: , + }, + { + icon: , + title: 'Connections', + content: , + }, + ]; + + return ( + <> + +
+
+ +
+ {username} + TS FullStack +
+
+
+
+
+ {tabs.map((tab, index) => ( + + ))} +
+
+
+
{tabs[currentTabIndex].content}
+ + ); +} + +export default UserProfile; diff --git a/src/pages/management/user/profile/profile-tab.tsx b/src/pages/management/user/profile/profile-tab.tsx new file mode 100644 index 00000000..0152d566 --- /dev/null +++ b/src/pages/management/user/profile/profile-tab.tsx @@ -0,0 +1,276 @@ +import { faker } from '@faker-js/faker'; +import { Row, Col, Typography, Timeline } from 'antd'; + +import Card from '@/components/card'; +import { IconButton, Iconify, SvgIcon } from '@/components/icon'; +import { useUserInfo } from '@/store/userStore'; +import ProTag from '@/theme/antd/components/tag'; +import { useThemeToken } from '@/theme/hooks'; + +export default function ProfileTab() { + const { username } = useUserInfo(); + const theme = useThemeToken(); + const AboutItems = [ + { icon: , label: 'Full Name', val: username }, + { icon: , label: 'Role', val: 'Developer' }, + { icon: , label: 'Country', val: 'USA' }, + { icon: , label: 'Language', val: 'English' }, + { icon: , label: 'Contact', val: '(123)456-7890' }, + { icon: , label: 'Email', val: username }, + ]; + + const ConnectionsItems = [ + { + avatar: faker.image.avatarLegacy(), + name: faker.name.fullName(), + connections: `${faker.number.int(100)} Connections`, + connected: faker.datatype.boolean(), + }, + + { + avatar: faker.image.avatarLegacy(), + name: faker.name.fullName(), + connections: `${faker.number.int(100)} Connections`, + connected: faker.datatype.boolean(), + }, + + { + avatar: faker.image.avatarLegacy(), + name: faker.name.fullName(), + connections: `${faker.number.int(100)} Connections`, + connected: faker.datatype.boolean(), + }, + + { + avatar: faker.image.avatarLegacy(), + name: faker.name.fullName(), + connections: `${faker.number.int(100)} Connections`, + connected: faker.datatype.boolean(), + }, + + { + avatar: faker.image.avatarLegacy(), + name: faker.name.fullName(), + connections: `${faker.number.int(100)} Connections`, + connected: faker.datatype.boolean(), + }, + ]; + + const TeamItems = [ + { + avatar: , + name: 'React Developers', + members: `${faker.number.int(100)} Members`, + tag: Developer, + }, + { + avatar: , + name: 'UI Designer', + members: `${faker.number.int(100)} Members`, + tag: Designer, + }, + { + avatar: , + name: 'Test Team', + members: `${faker.number.int(100)} Members`, + tag: Test, + }, + { + avatar: , + name: 'Nest.js Developers', + members: `${faker.number.int(100)} Members`, + tag: Developer, + }, + + { + avatar: , + name: 'Digital Marketing', + members: `${faker.number.int(100)} Members`, + tag: Marketing, + }, + ]; + + // const ProjectItems = [ + // { + // avatar: faker.image.urlPlaceholder(), + // name: faker.company.name(), + // createAt: faker.date.past(), + // leader: faker.person.fullName(), + // }, + // ]; + return ( + <> + + + +
+ About + {faker.lorem.paragraph()} + +
+ {AboutItems.map((item) => ( +
+
{item.icon}
+
{item.label}:
+
{item.val}
+
+ ))} +
+
+
+ + + + + Activity Timeline + +
+ 8 Invoices have been paid +
Wednesday
+
+ + Invoices have been paid to the company. + + +
+ + invoice.pdf +
+ + ), + }, + { + color: theme.colorPrimaryActive, + children: ( +
+
+ Create a new project for client 😎 +
April, 18
+
+ + Invoices have been paid to the company. + +
+ + + {faker.person.fullName()} (client) + +
+
+ ), + }, + { + color: theme.colorInfo, + children: ( +
+
+ Order #37745 from September +
January, 10
+
+ + Invoices have been paid to the company. + +
+ ), + }, + { + color: theme.colorWarning, + children: ( +
+
+ Public Meeting +
September, 30
+
+
+ ), + }, + ]} + /> +
+ +
+ + + +
+ Connections + + + +
+
+ {ConnectionsItems.map((item) => ( +
+ +
+ {item.name} + {item.connections} +
+
+ +
+
+ ))} +
+ +
+ View all connections +
+
+ + + +
+ Teams + + + +
+
+ {TeamItems.map((item) => ( +
+ {item.avatar} +
+ {item.name} + {item.members} +
+ {item.tag} +
+ ))} +
+ +
+ View all members +
+
+ +
+ + ); +} diff --git a/src/pages/management/user/profile/projects-tab.tsx b/src/pages/management/user/profile/projects-tab.tsx new file mode 100644 index 00000000..5d91e17c --- /dev/null +++ b/src/pages/management/user/profile/projects-tab.tsx @@ -0,0 +1,3 @@ +export default function ProjectsTab() { + return '3'; +} diff --git a/src/pages/management/user/profile/teams-tab.tsx b/src/pages/management/user/profile/teams-tab.tsx new file mode 100644 index 00000000..fc127776 --- /dev/null +++ b/src/pages/management/user/profile/teams-tab.tsx @@ -0,0 +1,3 @@ +export default function TeamsTab() { + return '2'; +} diff --git a/src/router/routes/modules/management.tsx b/src/router/routes/modules/management.tsx index 1461304f..060de90f 100644 --- a/src/router/routes/modules/management.tsx +++ b/src/router/routes/modules/management.tsx @@ -6,7 +6,7 @@ import { CircleLoading } from '@/components/loading'; import { AppRouteObject } from '#/router'; -const ProfilePage = lazy(() => import('@/pages/management/user/profile')); +const ProfilePage = lazy(() => import('@/pages/management/user/profile/index')); const Blog = lazy(() => import('@/pages/management/blog')); const management: AppRouteObject = {