diff --git a/examples/ecommerce-jewellery-store/index.html b/examples/ecommerce-jewellery-store/index.html index fbbb69d4..af77d546 100644 --- a/examples/ecommerce-jewellery-store/index.html +++ b/examples/ecommerce-jewellery-store/index.html @@ -17,15 +17,6 @@
- \ No newline at end of file diff --git a/examples/ecommerce-jewellery-store/public/404.html b/examples/ecommerce-jewellery-store/public/404.html deleted file mode 100644 index ed4503f7..00000000 --- a/examples/ecommerce-jewellery-store/public/404.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Page Not Found - - - - - \ No newline at end of file diff --git a/examples/ecommerce-jewellery-store/src/components/Header.tsx b/examples/ecommerce-jewellery-store/src/components/Header.tsx index 957ed557..ca9c2c9b 100644 --- a/examples/ecommerce-jewellery-store/src/components/Header.tsx +++ b/examples/ecommerce-jewellery-store/src/components/Header.tsx @@ -1,6 +1,6 @@ import React from "react"; import { useNavigate } from "react-router-dom"; -import { Menu, MenuSelectEvent } from "@progress/kendo-react-layout"; +import { Menu, MenuItemModel, MenuSelectEvent } from "@progress/kendo-react-layout"; import { Button } from "@progress/kendo-react-buttons"; import { SvgIcon } from "@progress/kendo-react-common"; import { InputPrefix, InputSeparator, TextBox, Switch } from "@progress/kendo-react-inputs"; @@ -12,6 +12,11 @@ import { AppBar, AppBarSection } from "@progress/kendo-react-layout"; import { useAdminContext } from "../helpers/AdminContext"; import { useCategoriesContext } from "../helpers/CategoriesContext"; +interface CustomMenuItemModel extends MenuItemModel { + page?: string; +} + + const Header: React.FC = () => { const navigate = useNavigate(); const { toggleRole } = useAdminContext(); @@ -26,10 +31,10 @@ const Header: React.FC = () => { }; const handleMenuSelect = (event: MenuSelectEvent) => { - const selectedItem = event.item; - - if (selectedItem.url) { - navigate(selectedItem.url); + const selectedItem: CustomMenuItemModel = event.item; + + if (selectedItem.page) { + navigate(selectedItem.page); return; } @@ -43,7 +48,6 @@ const Header: React.FC = () => { }; return ( - <> @@ -75,6 +79,7 @@ const Header: React.FC = () => { onClick={handleCartClick} /> { - ); }; diff --git a/examples/ecommerce-jewellery-store/src/data/items.ts b/examples/ecommerce-jewellery-store/src/data/items.ts index b428f1a1..d7728154 100644 --- a/examples/ecommerce-jewellery-store/src/data/items.ts +++ b/examples/ecommerce-jewellery-store/src/data/items.ts @@ -1,7 +1,7 @@ const items = [ { "text": "Home", - "url": "/" + "page": "/" }, { "text": "Jewelry", @@ -9,7 +9,7 @@ const items = [ }, { "text": "Contacts", - "url": "contacts" + "page": "contacts" } ]; diff --git a/examples/ecommerce-jewellery-store/src/styles.css b/examples/ecommerce-jewellery-store/src/styles.css index c17e56b3..0f1eeeca 100644 --- a/examples/ecommerce-jewellery-store/src/styles.css +++ b/examples/ecommerce-jewellery-store/src/styles.css @@ -23,4 +23,8 @@ html, body { position: fixed !important; top: auto !important; z-index: 1000; +} + +.switch-width { + width: 72px !important; } \ No newline at end of file diff --git a/examples/ecommerce-jewellery-store/vite.config.ts b/examples/ecommerce-jewellery-store/vite.config.ts index 52eea9e8..d94269f3 100644 --- a/examples/ecommerce-jewellery-store/vite.config.ts +++ b/examples/ecommerce-jewellery-store/vite.config.ts @@ -1,7 +1,6 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import path from 'path'; -import { resolve } from 'path'; import { fileURLToPath } from 'url'; const __filename = fileURLToPath(import.meta.url); @@ -17,12 +16,6 @@ export default defineConfig({ }, }, build: { - outDir: 'build', - rollupOptions: { - input: { - main: resolve(__dirname, "index.html"), - 404: resolve(__dirname, "public/404.html"), - }, - }, + outDir: 'build' }, }); \ No newline at end of file