Skip to content

Commit 8dc6ca6

Browse files
committed
add pages and layouts
1 parent 2e42e7c commit 8dc6ca6

File tree

17 files changed

+504
-16
lines changed

17 files changed

+504
-16
lines changed
559 KB
Loading
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import * as React from "react";
2+
import { Layout } from "../components/Layout";
3+
import { OrderedImgText } from "../components/OrderedImageCard";
4+
import { CustomSection } from "../components/CustomizedSection";
5+
import { listData } from "../data/listData";
6+
import { FilterComponent } from "../components/FilterComponent";
7+
import { CardsList } from "../components/CardsList";
8+
import { CategoryList } from "../components/CategoryList";
9+
import { CardDescriptor } from "../data/types";
10+
import { DataModel } from "../data/types";
11+
12+
import { Breadcrumb } from "@progress/kendo-react-layout";
13+
import { Button, ButtonGroup } from "@progress/kendo-react-buttons";
14+
import { layout2By2Icon, gridLayoutIcon } from "@progress/kendo-svg-icons";
15+
import { process, State } from "@progress/kendo-data-query";
16+
17+
export const AllProductsListView = () => {
18+
const title = "Fine Selection";
19+
const subtitle = "Enjoy the real craftsmanship";
20+
const contentText =
21+
"Jewelry is a meaningful form of self-expression that enhances personal style and adds beauty to any occasion.";
22+
const order = "first";
23+
24+
const [data, setData] = React.useState(listData);
25+
26+
const updateUI = (newState: State) => {
27+
const newData = process(listData, newState);
28+
setData(newData.data);
29+
};
30+
31+
const cards: CardDescriptor[] = [
32+
{
33+
img: "/necklace_1.jfif",
34+
collectionText: 'Collection "SERENE"',
35+
},
36+
{
37+
img: "/ring_1.jfif",
38+
collectionText: 'Collection "AURELIA"',
39+
},
40+
{
41+
img: "/1111.jfif",
42+
collectionText: 'Collection "RAVINA"',
43+
},
44+
];
45+
46+
const BreakcrumbData: DataModel[] = [
47+
{ text: "Home" },
48+
{ text: "Jewelry" },
49+
];
50+
51+
return (
52+
<>
53+
<Layout>
54+
<section
55+
className="k-d-grid k-grid-cols-12 k-justify-content-center k-align-items-center k-col-span-12"
56+
style={{
57+
paddingTop: "60px",
58+
}}
59+
>
60+
<OrderedImgText
61+
title={title}
62+
subtitle={subtitle}
63+
contentText={contentText}
64+
img="/bracelets.png"
65+
order={order}
66+
link={null}
67+
/>
68+
</section>
69+
</Layout>
70+
<Layout>
71+
<CustomSection>
72+
<CategoryList title="Our Collections" subtitle="Enjoy an excellent selection of fine jewelry" data={cards} />
73+
</CustomSection>
74+
</Layout>
75+
<Layout>
76+
<section className="k-d-flex k-justify-content-between">
77+
<Breadcrumb data={BreakcrumbData} />
78+
<ButtonGroup>
79+
<Button fillMode={"flat"} svgIcon={gridLayoutIcon} />
80+
<Button fillMode={"flat"} svgIcon={layout2By2Icon} />
81+
</ButtonGroup>
82+
</section>
83+
</Layout>
84+
<Layout>
85+
<FilterComponent updateUI={updateUI} />
86+
</Layout>
87+
<Layout>
88+
<CardsList data={data} />
89+
</Layout>
90+
</>
91+
);
92+
};
93+
94+
export default AllProductsListView
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import * as React from 'react';
2+
3+
import {
4+
DropDownList,
5+
DropDownListChangeEvent,
6+
} from '@progress/kendo-react-dropdowns';
7+
8+
const AppointmentInput: React.FC = () => {
9+
const appointments = [
10+
{ text: 'Customer Service Appointment', id: 1 },
11+
{ text: 'Sales Representative Appointment', id: 2 },
12+
{ text: 'Refund Appointment', id: 3 },
13+
];
14+
15+
const [state, setState] = React.useState({
16+
value: { text: 'Customer Service Appointment', id: 1 },
17+
});
18+
19+
const handleChange = (event: DropDownListChangeEvent) => {
20+
setState({
21+
value: event.target.value,
22+
});
23+
};
24+
25+
return (
26+
<DropDownList
27+
data={appointments}
28+
textField="text"
29+
dataItemKey="id"
30+
value={state.value}
31+
onChange={handleChange}
32+
/>
33+
);
34+
};
35+
36+
export default AppointmentInput;
37+

examples/kendo-react-e-commerce-astro-app/src/components/CardsList.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import { CardListProps } from "../data/types";
55
import { useNavigate } from "react-router-dom";
66

77
export const CardsList = (props: CardListProps) => {
8-
const navigate = useNavigate();
98

109
const onButtonClick = (index: number) => {
11-
navigate(`/product/${index + 1}`);
10+
// navigate(`/product/${index + 1}`);
1211
};
1312

1413
return (
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import * as React from 'react';
2+
3+
import {
4+
DropDownList,
5+
DropDownListChangeEvent,
6+
} from '@progress/kendo-react-dropdowns';
7+
8+
const CityInput: React.FC = () => {
9+
const cities = [
10+
{ text: 'London', id: 1 },
11+
{ text: 'Liverpool', id: 2 },
12+
{ text: 'Canterbury', id: 3 },
13+
{ text: 'Lancaster', id: 4 },
14+
];
15+
16+
const [state, setState] = React.useState({
17+
value: { text: 'Liverpool', id: 2 },
18+
});
19+
20+
const handleChange = (event: DropDownListChangeEvent) => {
21+
setState({
22+
value: event.target.value,
23+
});
24+
};
25+
26+
return (
27+
<DropDownList
28+
data={cities}
29+
textField="text"
30+
dataItemKey="id"
31+
value={state.value}
32+
onChange={handleChange}
33+
/>
34+
);
35+
};
36+
37+
export default CityInput;

examples/kendo-react-e-commerce-astro-app/src/components/Contacts.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ import CityInput from '../components/CityInput';
99
import PhoneInput from '../components/PhoneInput';
1010
import AppointmentInput from '../components/AppointmentInput';
1111
import DateChooserInput from '../components/DateChooserInput';
12-
import ContactsRadioButtons from '../components/ContactsRadioButtons'
13-
import { BackgroundImage } from '../components/BackgroundImage';
14-
import contactsImage from '@/assets/contactsImage.png';
12+
import ContactsRadioButtons from '../components/ContactsRadioButtons';
1513
import { Button } from '@progress/kendo-react-buttons';
1614

1715
import {
@@ -20,15 +18,11 @@ import {
2018
FormElement,
2119
FieldWrapper,
2220
} from '@progress/kendo-react-form';
23-
import { RadioButton } from '@progress/kendo-react-inputs';
2421
import { Label } from '@progress/kendo-react-labels';
2522

26-
import creditCards from '../assets/creditCards.png';
27-
2823
const Contacts: React.FC = () => {
29-
3024
const onSubmitClick = () => {
31-
window.location.href="/thankyou"2
25+
window.location.href = "/thankyou";
3226
};
3327

3428
return (
@@ -56,7 +50,7 @@ const Contacts: React.FC = () => {
5650
</FieldWrapper>
5751
<div className="k-d-flex k-flex-col k-align-items-start k-gap-4">
5852
<p>Type of customer</p>
59-
<ContactsRadioButtons/>
53+
<ContactsRadioButtons />
6054
</div>
6155
<FieldWrapper className="k-col-span-1">
6256
<Field name="city" component={CityInput} />
@@ -82,7 +76,7 @@ const Contacts: React.FC = () => {
8276
</div>
8377
<div className="k-col-span-5 k-col-start-8 k-d-flex k-flex-col k-align-items-start">
8478
<img
85-
src={contactsImage}
79+
src="/contactsImage.png"
8680
alt="Contacts"
8781
style={{
8882
maxWidth: '630px',
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
3+
import * as React from 'react';
4+
5+
import { RadioButton, RadioButtonChangeEvent } from '@progress/kendo-react-inputs';
6+
7+
const ContactsRadioButtons: React.FC = () => {
8+
const [selectedValue, setSelectedValue] = React.useState('first');
9+
10+
const handleChange = React.useCallback(
11+
(e: RadioButtonChangeEvent) => {
12+
setSelectedValue(e.value);
13+
},
14+
[setSelectedValue]
15+
);
16+
17+
return (
18+
<div className="k-d-flex k-gap-4">
19+
<RadioButton name="group1" value="new" checked={selectedValue === 'new'} label="New" onChange={handleChange} />
20+
<br />
21+
<RadioButton name="group2" value="existing" checked={selectedValue === 'existing'} label="Existing" onChange={handleChange} />
22+
<br />
23+
<RadioButton name="group3" value="just curious" checked={selectedValue === 'just curious'} label="Just curious" onChange={handleChange} />
24+
</div>
25+
);
26+
}
27+
28+
export default ContactsRadioButtons;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as React from 'react';
2+
import { DateInput, DateInputChangeEvent } from '@progress/kendo-react-dateinputs';
3+
4+
const DateChooserInput: React.FC = () => {
5+
const [value, setValue] = React.useState<Date | null>(new Date(2017, 1, 13));
6+
const min = new Date(2000, 2, 10);
7+
const max = new Date(2020, 2, 10);
8+
9+
const changeDate = (event: DateInputChangeEvent) => {
10+
setValue(event.value);
11+
};
12+
13+
return <div>
14+
<DateInput value={value} min={min} max={max} onChange={changeDate} />
15+
</div>;
16+
};
17+
18+
export default DateChooserInput;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as React from 'react';
2+
import { Input, InputChangeEvent } from '@progress/kendo-react-inputs';
3+
import { Button } from '@progress/kendo-react-buttons';
4+
import { eyeIcon, eyeSlashIcon } from '@progress/kendo-svg-icons';
5+
6+
const EmailInput: React.FC = () => {
7+
8+
return (
9+
<div>
10+
<Input placeholder="[email protected]"/>
11+
</div>
12+
);
13+
};
14+
15+
export default EmailInput;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { MaskedTextBox } from '@progress/kendo-react-inputs';
2+
3+
const PhoneNumber: React.FC = () => {
4+
return (
5+
<MaskedTextBox mask="(999) 000-00-00-00" defaultValue="(359) 884-12-33-21" />
6+
);
7+
};
8+
9+
export default PhoneNumber;

0 commit comments

Comments
 (0)