Skip to content

Commit 2614259

Browse files
committed
chore: add detials window
1 parent ca9ee29 commit 2614259

File tree

1 file changed

+48
-5
lines changed
  • examples/kendo-react-freemium/src/pages

1 file changed

+48
-5
lines changed

examples/kendo-react-freemium/src/pages/Team.tsx

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ButtonGroup, Button, FloatingActionButton } from "@progress/kendo-react
55
import { Breadcrumb, Card, CardBody, Avatar, CardTitle, CardSubtitle, CardFooter, BreadcrumbLinkMouseEvent, GridLayout } from "@progress/kendo-react-layout";
66
import { groupIcon, listUnorderedSquareIcon, homeIcon, detailSectionIcon, plusIcon } from "@progress/kendo-svg-icons";
77
import { SvgIcon } from "@progress/kendo-react-common";
8+
import { Window } from '@progress/kendo-react-dialogs';
89
import React from "react";
910

1011
interface DataModel {
@@ -17,6 +18,8 @@ export default function Team() {
1718
let params = useParams();
1819
const navigate = useNavigate();
1920
const [isGridView, setIsGridView] = React.useState(true);
21+
const [openWindow, setOpenWindow] = React.useState(false);
22+
const [windowContent, setWindowContent] = React.useState({ teamMember: '', title: '' });
2023
const team = teamsData.filter(team => team.teamCode === params.teamId)[0];
2124

2225
const breadcrumbItems: DataModel[] = [
@@ -57,8 +60,17 @@ export default function Team() {
5760
return firstNameInitial + lastNameInitial;
5861
}
5962

60-
const openDetailsWindow = () => {
63+
const getEmail = (fullName: string) => {
64+
const nameParts = fullName.split(" ");
65+
return nameParts[0].toLowerCase() + '_' + nameParts[1].toLowerCase() + '@company.com';
66+
}
6167

68+
const openDetailsWindow = (member: { teamMember: string; title: string }) => {
69+
setWindowContent({
70+
teamMember: member.teamMember,
71+
title: member.title,
72+
});
73+
setOpenWindow(!openWindow);
6274
};
6375

6476
return (
@@ -68,7 +80,7 @@ export default function Team() {
6880

6981
<div>
7082
<h1 className="text-4xl">{teamsData.map(team => { return team.teamCode === params.teamId ? team.teamName : '' })}</h1>
71-
<h5 className="text-subtle">{teamsData.map(team => { return team.teamCode === params.teamId ? team.teamMembers.length : '' })} team members</h5>
83+
<h5 className="text-subtle">{teamsData.map(team => { return team.teamCode === params.teamId ? team.teamMembers.length : '' })} members</h5>
7284
</div>
7385

7486
<div className="flex justify-between items-start gap-6">
@@ -91,15 +103,46 @@ export default function Team() {
91103
</div>
92104
</CardBody>
93105
<CardFooter className="border-0 p-2">
94-
<Button svgIcon={detailSectionIcon} fillMode="flat" onClick={openDetailsWindow}>Details</Button>
106+
<Button svgIcon={detailSectionIcon} fillMode="flat" onClick={() => openDetailsWindow(member)}>Details</Button>
95107
</CardFooter>
96108
</Card>
109+
110+
97111
})}
98112
</GridLayout>
99113

100114
<div className="flex justify-end mt-auto">
101-
<FloatingActionButton svgIcon={plusIcon} text="Add new member" size="small" alignOffset={{ x: 40, y: 75 }}/>
102-
</div>
115+
<FloatingActionButton svgIcon={plusIcon} text="Add new member" size="small" alignOffset={{ x: 40, y: 75 }}/>
116+
</div>
117+
118+
{openWindow &&
119+
<Window title={windowContent.teamMember + ' Details'} initialWidth={480} onClose={() => setOpenWindow(false)}>
120+
<div className="flex flex-col gap-4">
121+
<div className="flex gap-2 items-center">
122+
<Avatar className="bg-[#008B8B]">JS</Avatar>
123+
<div className="flex flex-col gap-1">
124+
<span className="text-lg font-medium">{windowContent.teamMember}</span>
125+
<span className="text-subtle">{windowContent.title}</span>
126+
</div>
127+
</div>
128+
<div className="flex gap-1">
129+
<span className="color-subtle">Team:</span>
130+
<span className="underline">{team.teamName}</span>
131+
</div>
132+
<div className="flex gap-1">
133+
<span className="color-subtle">Email:</span>
134+
<span className="underline">{getEmail(windowContent.teamMember)}</span>
135+
</div>
136+
<div className="flex gap-1">
137+
<span className="color-subtle">Phone Number:</span>
138+
<span>(436)-256-140-482</span>
139+
</div>
140+
<div className="flex gap-1">
141+
<span className="color-subtle">Reports to:</span>
142+
<span className="underline">{team.teamMembers[0].teamMember}</span>
143+
</div>
144+
</div>
145+
</Window>}
103146
</div>
104147
<div className="bg-surface-alt color-subtle p-2 text-center">
105148
<span>Copyright &#169; 2025 Progress Software. All rights reserved.</span>

0 commit comments

Comments
 (0)