Skip to content

Commit 1d5f3eb

Browse files
chore: loading and default route to dashboard
1 parent bd560dc commit 1d5f3eb

File tree

10 files changed

+60
-8
lines changed

10 files changed

+60
-8
lines changed
64.2 KB
Loading

examples/coffee-warehouse-nextjs/app/components/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useLocalization } from "@progress/kendo-react-intl";
99
import { locales } from "./../resources/locales";
1010
import Image from "next/image";
1111

12-
import userAvatar from "../assets/teammember-04.png";
12+
import userAvatar from "../assets/userImage.png";
1313
const noMessage = "message not defined";
1414

1515
export const Header = (props) => {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
"use client";
2+
3+
import { Fragment } from "react";
4+
import { Skeleton } from "@progress/kendo-react-indicators";
5+
6+
export default function DashBoardSkeleton() {
7+
return (
8+
<Fragment>
9+
<Skeleton
10+
shape={"rectangle"}
11+
style={{
12+
width: "100%",
13+
height: "345px",
14+
margin: "50px",
15+
background: "white",
16+
}}
17+
/>
18+
<Skeleton
19+
shape={"rectangle"}
20+
style={{
21+
width: "100%",
22+
height: "500px",
23+
margin: "50px",
24+
background: "white",
25+
}}
26+
/>
27+
</Fragment>
28+
);
29+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import DashBoardSkeleton from "./dashboard-skeleton";
2+
13
export default function Loading() {
2-
return 'Loading dashboard...';
4+
return <DashBoardSkeleton />
35
}

examples/coffee-warehouse-nextjs/app/warehouse/dashboard/page.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default async function Page() {
77
);
88

99
const getEmployees = async() => {
10-
await delay(3000);
10+
await delay(1000);
1111
return employees;
1212
}
1313
const data = await getEmployees();

examples/coffee-warehouse-nextjs/app/warehouse/loading.tsx

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import PlanningLoader from "./planning-loader";
2+
13
export default function Loading() {
2-
return 'Loading planning...';
4+
return <PlanningLoader />
35
}

examples/coffee-warehouse-nextjs/app/warehouse/planning/page.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default async function Page() {
66
);
77

88
const getEmployees = async() => {
9-
await delay(3000);
9+
await delay(1000);
1010
return employees;
1111
}
1212
const data = await getEmployees();
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use client";
2+
3+
import { Loader } from "@progress/kendo-react-indicators";
4+
import { Fragment } from "react";
5+
6+
export default function PlanningLoader() {
7+
return (
8+
<Fragment>
9+
<span>Loading Planning Data</span>
10+
<Loader size="large" type={'pulsing'} />
11+
</Fragment>
12+
);
13+
}

examples/coffee-warehouse-nextjs/next.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,13 @@ module.exports = {
55
includePaths: [path.join(__dirname, 'styles')],
66
prependData: `@import "~@styles/main.scss";`,
77
},
8+
async redirects() {
9+
return [
10+
{
11+
source: '/',
12+
destination: '/warehouse/dashboard',
13+
permanent: true,
14+
},
15+
]
16+
},
817
}

0 commit comments

Comments
 (0)