Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit ac6e875

Browse files
Main demo (#4)
* Add conditional execution for CloudFront invalidation based on branch * Comment out unused components and navigation items for future reference * Comment out AdminBottomNavigationBar component for future reference
1 parent 2b6329d commit ac6e875

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ jobs:
193193
invalidate_cloudfront:
194194
runs-on: ubuntu-latest
195195
needs: [sync_to_s3, deploy_cloudfront]
196+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/stage'
196197
steps:
197198
- name: Checkout
198199
uses: actions/checkout@v4

src/components/admin/common/AdminBottomNavigationBar.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { BottomNavigation, BottomNavigationAction, Box } from '@mui/material';
22
import { SyntheticEvent } from 'react';
33
import RestaurantMenuIcon from '@mui/icons-material/RestaurantMenu';
44
import ReceiptLongOutlinedIcon from '@mui/icons-material/ReceiptLongOutlined';
5-
import SpaceDashboardOutlinedIcon from '@mui/icons-material/SpaceDashboardOutlined';
5+
// import SpaceDashboardOutlinedIcon from '@mui/icons-material/SpaceDashboardOutlined';
66
import { useNavigate, useParams } from 'react-router-dom';
77

88
// Defining the structure of navigation items
@@ -12,17 +12,17 @@ interface NavigationItem {
1212
icon: JSX.Element;
1313
}
1414

15-
const NAVIGATION_VALUES: Record<'Menu' | 'Dashboard' | 'Orders', NavigationItem> = {
15+
const NAVIGATION_VALUES: Record<'Menu' | 'Orders', NavigationItem> = {
1616
Menu: {
1717
label: 'Menu',
1818
href: '/admin/editMenu',
1919
icon: <RestaurantMenuIcon />,
2020
},
21-
Dashboard: {
22-
label: 'Dashboard',
23-
href: '/admin/dashboard',
24-
icon: <SpaceDashboardOutlinedIcon />,
25-
},
21+
// Dashboard: {
22+
// label: 'Dashboard',
23+
// href: '/admin/dashboard',
24+
// icon: <SpaceDashboardOutlinedIcon />,
25+
// },
2626
Orders: {
2727
label: 'Orders',
2828
href: '/admin/orders',

src/components/common/MenuItemCard.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect, useState } from 'react';
22
import { Box, Stack, Typography } from '@mui/material';
3-
import QuantityEditor from '../user/menu/QuantityEditor';
3+
// import QuantityEditor from '../user/menu/QuantityEditor';
44
import { MenuItem } from '../../interfaces/MenuItem';
55
import ItemEditor from '../admin/editMenu/ItemEditor';
66
import CircleIcon from '@mui/icons-material/Circle';
@@ -107,7 +107,8 @@ const MenuItemCard = ({
107107
}}
108108
/>
109109
) : (
110-
<QuantityEditor menuItem={menuItem} />
110+
<></>
111+
// <QuantityEditor menuItem={menuItem} />
111112
)}
112113
</Box>
113114
<Typography onClick={handleClick}>{getDescription()}</Typography>

src/main.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createTheme, ThemeProvider } from '@mui/material';
1111
import Home from './routes/Home';
1212
import { MenuProvider } from './contexts/CartContext';
1313
import UserOrders from './routes/UserOrders';
14-
import Dashboard from './routes/Dashboard';
14+
// import Dashboard from './routes/Dashboard';
1515
import RestaurantOrders from './routes/RestaurantOrders';
1616

1717
const router = createBrowserRouter([
@@ -27,10 +27,10 @@ const router = createBrowserRouter([
2727
path: '/:restaurantId/orders',
2828
element: <UserOrders />,
2929
},
30-
{
31-
path: '/:restaurantId/admin/dashboard',
32-
element: <Dashboard />,
33-
},
30+
// {
31+
// path: '/:restaurantId/admin/dashboard',
32+
// element: <Dashboard />,
33+
// },
3434
// {
3535
// path: '/:restaurantId/trending',
3636
// element: <Trending />,

src/routes/Dashboard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Box, Skeleton, Typography, Grid2 as Grid, Card } from '@mui/material';
2-
import AdminBottomNavigationBar from '../components/admin/common/AdminBottomNavigationBar';
2+
// import AdminBottomNavigationBar from '../components/admin/common/AdminBottomNavigationBar';
33
import { useState } from 'react';
44

55
function Dashboard() {
@@ -65,7 +65,7 @@ function Dashboard() {
6565
></Card>
6666
</Grid>
6767
</Grid>
68-
<AdminBottomNavigationBar value='Dashboard' />
68+
{/* <AdminBottomNavigationBar value='Dashboard' /> */}
6969
</Box>
7070
);
7171
}

src/routes/Menu.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
Typography,
1919
} from '@mui/material';
2020
import { SearchOutlined } from '@mui/icons-material';
21-
import UserBottomNavigationBar from '../components/user/common/UserBottomNavigationBar';
21+
// import UserBottomNavigationBar from '../components/user/common/UserBottomNavigationBar';
2222
import MenuItemCard from '../components/common/MenuItemCard';
2323
import CardButton from '../components/common/CardButton';
2424
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
@@ -1000,7 +1000,8 @@ export default function Menu({ admin = false }: { admin?: boolean }) {
10001000
}}
10011001
/>
10021002
{/* Bottom Navigation Bar */}
1003-
{admin ? <AdminBottomNavigationBar value={'Menu'} /> : <UserBottomNavigationBar value='Menu' />}
1003+
{/* {admin ? <AdminBottomNavigationBar value={'Menu'} /> : <UserBottomNavigationBar value='Menu' />} */}
1004+
{admin && <AdminBottomNavigationBar value={'Menu'} />}
10041005
</Box>
10051006
);
10061007
}

0 commit comments

Comments
 (0)