Skip to content

Commit 8c02346

Browse files
committed
chore: add new member dialog
1 parent 2614259 commit 8c02346

File tree

1 file changed

+49
-3
lines changed
  • examples/kendo-react-freemium/src/pages

1 file changed

+49
-3
lines changed

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

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ import { useNavigate } from "react-router-dom";
33
import { teamsData } from "./data";
44
import { ButtonGroup, Button, FloatingActionButton } from "@progress/kendo-react-buttons";
55
import { Breadcrumb, Card, CardBody, Avatar, CardTitle, CardSubtitle, CardFooter, BreadcrumbLinkMouseEvent, GridLayout } from "@progress/kendo-react-layout";
6-
import { groupIcon, listUnorderedSquareIcon, homeIcon, detailSectionIcon, plusIcon } from "@progress/kendo-svg-icons";
6+
import { groupIcon, listUnorderedSquareIcon, homeIcon, detailSectionIcon, plusIcon, xIcon } from "@progress/kendo-svg-icons";
77
import { SvgIcon } from "@progress/kendo-react-common";
8-
import { Window } from '@progress/kendo-react-dialogs';
8+
import { Dialog, DialogActionsBar, Window } from '@progress/kendo-react-dialogs';
99
import React from "react";
10+
import { MaskedTextBox, TextBox } from "@progress/kendo-react-inputs";
11+
import { FloatingLabel, Hint } from "@progress/kendo-react-labels";
12+
import { MultiSelect } from "@progress/kendo-react-dropdowns";
1013

1114
interface DataModel {
1215
id: string;
@@ -20,6 +23,14 @@ export default function Team() {
2023
const [isGridView, setIsGridView] = React.useState(true);
2124
const [openWindow, setOpenWindow] = React.useState(false);
2225
const [windowContent, setWindowContent] = React.useState({ teamMember: '', title: '' });
26+
const [openDialog, setOpenDialog] = React.useState(false);
27+
const [fNValue, setFNValue] = React.useState('First Name');
28+
const [lNValue, setLNValue] = React.useState('Last Name');
29+
const [emailValue, setEmailValue] = React.useState('Email');
30+
const [titleValue, setTitleValue] = React.useState('Job Title');
31+
const [phoneValue, setPhoneValue] = React.useState('(___) ___-___-___');
32+
const [reportsToValue, setReportsToValue] = React.useState(['Name', 'Name']);
33+
2334
const team = teamsData.filter(team => team.teamCode === params.teamId)[0];
2435

2536
const breadcrumbItems: DataModel[] = [
@@ -73,6 +84,9 @@ export default function Team() {
7384
setOpenWindow(!openWindow);
7485
};
7586

87+
const addNewMember = () => {
88+
setOpenDialog(true);
89+
}
7690
return (
7791
<>
7892
<div style={{minHeight: 'calc(100vh - 106px)'}} className="flex flex-col p-10 gap-6">
@@ -112,7 +126,7 @@ export default function Team() {
112126
</GridLayout>
113127

114128
<div className="flex justify-end mt-auto">
115-
<FloatingActionButton svgIcon={plusIcon} text="Add new member" size="small" alignOffset={{ x: 40, y: 75 }}/>
129+
<FloatingActionButton svgIcon={plusIcon} text="Add new member" size="small" alignOffset={{ x: 40, y: 75 }} onClick={addNewMember} />
116130
</div>
117131

118132
{openWindow &&
@@ -143,6 +157,38 @@ export default function Team() {
143157
</div>
144158
</div>
145159
</Window>}
160+
161+
{openDialog && <Dialog title="Add Member" width={450} onClose={() => setOpenDialog(false)}>
162+
<div className="flex flex-col gap-4">
163+
<FloatingLabel label="First Name" editorId={'first-name'} editorValue={fNValue}>
164+
<TextBox size="large" value={fNValue} onChange={e => setFNValue(e.value as string)} />
165+
</FloatingLabel>
166+
<FloatingLabel label="Last Name" editorId={'last-name'} editorValue={lNValue}>
167+
<TextBox size="large" value={lNValue} onChange={e => setLNValue(e.value as string)} />
168+
</FloatingLabel>
169+
<FloatingLabel label="Job Title" editorId={'job-title'} editorValue={titleValue}>
170+
<TextBox size="large" value={titleValue} onChange={e => setTitleValue(e.value as string)} />
171+
</FloatingLabel>
172+
<FloatingLabel label="Email" editorId={'email'} editorValue={emailValue}>
173+
<TextBox size="large" value={emailValue} onChange={e => setEmailValue(e.value as string)} />
174+
</FloatingLabel>
175+
<FloatingLabel label="Phone Number" editorId={'phone'} editorValue={phoneValue}>
176+
<MaskedTextBox size="large" value={phoneValue} mask="(999) 000-000-000" onChange={e => setPhoneValue(e.value as string)} />
177+
</FloatingLabel>
178+
<FloatingLabel label="Reports to" editorId={'email'} editorValue={emailValue}>
179+
<MultiSelect size="large" data={['William Smith', 'Alex Morgan', 'James Parker', 'Nina Roberts', 'Isabella White']} value={reportsToValue} onChange={e => setReportsToValue([...e.value])} />
180+
<Hint>Multiple options could be selected at once.</Hint>
181+
</FloatingLabel>
182+
</div>
183+
<DialogActionsBar>
184+
<Button type="button" themeColor={'primary'} onClick={() => alert('Member added successfully!')}>
185+
Save
186+
</Button>
187+
<Button type="button" onClick={() => setOpenDialog(false)}>
188+
Cancel
189+
</Button>
190+
</DialogActionsBar>
191+
</Dialog>}
146192
</div>
147193
<div className="bg-surface-alt color-subtle p-2 text-center">
148194
<span>Copyright &#169; 2025 Progress Software. All rights reserved.</span>

0 commit comments

Comments
 (0)