balibabu
commited on
Commit
·
00c857e
1
Parent(s):
1db6d0f
Feat: Add TeamManagement component #3221 (#3626)
Browse files### What problem does this PR solve?
Feat: Add TeamManagement component #3221
### Type of change
- [x] New Feature (non-breaking change which adds functionality)
web/src/pages/profile-setting/index.tsx
CHANGED
@@ -1,11 +1,9 @@
|
|
1 |
import { Button } from '@/components/ui/button';
|
2 |
import { ArrowLeft } from 'lucide-react';
|
3 |
import { Outlet } from 'umi';
|
4 |
-
import { useGetPageTitle } from './hooks';
|
5 |
import { SideBar } from './sidebar';
|
6 |
|
7 |
export default function ProfileSetting() {
|
8 |
-
const title = useGetPageTitle();
|
9 |
return (
|
10 |
<div className="flex flex-col w-full h-screen bg-background text-foreground">
|
11 |
<header className="flex items-center border-b">
|
@@ -24,9 +22,9 @@ export default function ProfileSetting() {
|
|
24 |
<div className="flex flex-1 bg-muted/50">
|
25 |
<SideBar></SideBar>
|
26 |
|
27 |
-
<main className="flex-1
|
28 |
-
<h1 className="text-3xl font-bold mb-6"> {title}</h1>
|
29 |
<Outlet></Outlet>
|
|
|
30 |
</main>
|
31 |
</div>
|
32 |
</div>
|
|
|
1 |
import { Button } from '@/components/ui/button';
|
2 |
import { ArrowLeft } from 'lucide-react';
|
3 |
import { Outlet } from 'umi';
|
|
|
4 |
import { SideBar } from './sidebar';
|
5 |
|
6 |
export default function ProfileSetting() {
|
|
|
7 |
return (
|
8 |
<div className="flex flex-col w-full h-screen bg-background text-foreground">
|
9 |
<header className="flex items-center border-b">
|
|
|
22 |
<div className="flex flex-1 bg-muted/50">
|
23 |
<SideBar></SideBar>
|
24 |
|
25 |
+
<main className="flex-1 ">
|
|
|
26 |
<Outlet></Outlet>
|
27 |
+
{/* <h1 className="text-3xl font-bold mb-6"> {title}</h1> */}
|
28 |
</main>
|
29 |
</div>
|
30 |
</div>
|
web/src/pages/profile-setting/profile/index.tsx
CHANGED
@@ -11,7 +11,8 @@ import {
|
|
11 |
|
12 |
export default function Profile() {
|
13 |
return (
|
14 |
-
<section>
|
|
|
15 |
<Avatar className="w-[120px] h-[120px] mb-6">
|
16 |
<AvatarImage
|
17 |
src={
|
|
|
11 |
|
12 |
export default function Profile() {
|
13 |
return (
|
14 |
+
<section className="p-8">
|
15 |
+
<h1 className="text-3xl font-bold mb-6">User profile</h1>
|
16 |
<Avatar className="w-[120px] h-[120px] mb-6">
|
17 |
<AvatarImage
|
18 |
src={
|
web/src/pages/profile-setting/team/index.tsx
CHANGED
@@ -1,3 +1,107 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Button } from '@/components/ui/button';
|
2 |
+
import { Card } from '@/components/ui/card';
|
3 |
+
import {
|
4 |
+
DropdownMenu,
|
5 |
+
DropdownMenuContent,
|
6 |
+
DropdownMenuItem,
|
7 |
+
DropdownMenuTrigger,
|
8 |
+
} from '@/components/ui/dropdown-menu';
|
9 |
+
import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table';
|
10 |
+
import { ChevronDown, MoreVertical, Plus, UserPlus } from 'lucide-react';
|
11 |
+
|
12 |
+
interface TeamMember {
|
13 |
+
email: string;
|
14 |
+
name: string;
|
15 |
+
role: string;
|
16 |
}
|
17 |
+
|
18 |
+
const TeamManagement = () => {
|
19 |
+
const teamMembers: TeamMember[] = [
|
20 |
+
{ email: '[email protected]', name: 'Yifan Wu', role: 'Admin' },
|
21 |
+
{ email: '[email protected]', name: 'Yifan Wu', role: 'Admin' },
|
22 |
+
];
|
23 |
+
|
24 |
+
const stats = {
|
25 |
+
project: 1,
|
26 |
+
token: '1,000',
|
27 |
+
storage: '1GB',
|
28 |
+
};
|
29 |
+
|
30 |
+
return (
|
31 |
+
<div className="min-h-screen text-white p-8 ">
|
32 |
+
<div className="max-w-6xl mx-auto">
|
33 |
+
<div className="flex justify-between items-center mb-8">
|
34 |
+
<h1 className="text-4xl font-bold">Team management</h1>
|
35 |
+
<Button className="hover:bg-[#6B4FD8] text-white bg-colors-background-core-standard">
|
36 |
+
<Plus className="mr-2 h-4 w-4" />
|
37 |
+
Create team
|
38 |
+
</Button>
|
39 |
+
</div>
|
40 |
+
|
41 |
+
<div className="mb-8">
|
42 |
+
<div className="flex justify-between items-center mb-4">
|
43 |
+
<h2 className="text-2xl font-semibold">Yifan's team</h2>
|
44 |
+
<Button variant="secondary" size="icon">
|
45 |
+
<ChevronDown className="h-4 w-4" />
|
46 |
+
</Button>
|
47 |
+
</div>
|
48 |
+
|
49 |
+
<Card className="border-0 p-6 mb-6 bg-colors-background-inverse-weak">
|
50 |
+
<div className="grid grid-cols-3 gap-8">
|
51 |
+
<div>
|
52 |
+
<p className="text-sm text-gray-400 mb-2">Project</p>
|
53 |
+
<p className="text-2xl font-semibold">{stats.project}</p>
|
54 |
+
</div>
|
55 |
+
<div>
|
56 |
+
<p className="text-sm text-gray-400 mb-2">Token</p>
|
57 |
+
<p className="text-2xl font-semibold">{stats.token}</p>
|
58 |
+
</div>
|
59 |
+
<div>
|
60 |
+
<p className="text-sm text-gray-400 mb-2">Storage</p>
|
61 |
+
<p className="text-2xl font-semibold">{stats.storage}</p>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
</Card>
|
65 |
+
|
66 |
+
<Card className="border-0 p-6 bg-colors-background-inverse-weak">
|
67 |
+
<Table>
|
68 |
+
<TableBody>
|
69 |
+
{teamMembers.map((member, idx) => (
|
70 |
+
<TableRow key={idx}>
|
71 |
+
<TableCell>{member.email}</TableCell>
|
72 |
+
<TableCell>{member.name}</TableCell>
|
73 |
+
<TableCell className="flex items-center justify-end">
|
74 |
+
<span className="text-colors-text-core-standard">
|
75 |
+
{member.role}
|
76 |
+
</span>
|
77 |
+
<DropdownMenu>
|
78 |
+
<DropdownMenuTrigger asChild>
|
79 |
+
<Button variant="ghost" size="icon">
|
80 |
+
<MoreVertical className="h-4 w-4" />
|
81 |
+
</Button>
|
82 |
+
</DropdownMenuTrigger>
|
83 |
+
<DropdownMenuContent align="end">
|
84 |
+
<DropdownMenuItem>Edit</DropdownMenuItem>
|
85 |
+
<DropdownMenuItem className="text-red-600">
|
86 |
+
Remove
|
87 |
+
</DropdownMenuItem>
|
88 |
+
</DropdownMenuContent>
|
89 |
+
</DropdownMenu>
|
90 |
+
</TableCell>
|
91 |
+
</TableRow>
|
92 |
+
))}
|
93 |
+
</TableBody>
|
94 |
+
</Table>
|
95 |
+
|
96 |
+
<Button variant="outline" className="mt-6 ">
|
97 |
+
<UserPlus className="mr-2 h-4 w-4" />
|
98 |
+
Invite member
|
99 |
+
</Button>
|
100 |
+
</Card>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
);
|
105 |
+
};
|
106 |
+
|
107 |
+
export default TeamManagement;
|
web/tailwind.config.js
CHANGED
@@ -29,6 +29,8 @@ module.exports = {
|
|
29 |
'colors-outline-sentiment-primary':
|
30 |
'var(--colors-outline-sentiment-primary)',
|
31 |
|
|
|
|
|
32 |
primary: {
|
33 |
DEFAULT: 'hsl(var(--primary))',
|
34 |
foreground: 'hsl(var(--primary-foreground))',
|
|
|
29 |
'colors-outline-sentiment-primary':
|
30 |
'var(--colors-outline-sentiment-primary)',
|
31 |
|
32 |
+
'colors-text-core-standard': 'var(--colors-text-core-standard)',
|
33 |
+
|
34 |
primary: {
|
35 |
DEFAULT: 'hsl(var(--primary))',
|
36 |
foreground: 'hsl(var(--primary-foreground))',
|