Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
formatting and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DCRepublic committed Apr 1, 2024
1 parent 8a158ab commit 0692c34
Show file tree
Hide file tree
Showing 25 changed files with 507 additions and 541 deletions.
1 change: 0 additions & 1 deletion src/app/(header)/admin/analytics/card.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Admin Analytics
import { Typography, CardContent, Card, CardActions } from '@mui/material';
import styles from './page.module.css';
import { TrendingUp, TrendingDown } from '@mui/icons-material';
import { useTheme } from '@mui/material/styles';

export default function BasicCard({ title, data, up }) {
Expand Down
25 changes: 10 additions & 15 deletions src/app/(header)/admin/analytics/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
// Admin Analytics
'use client';
import { Grid, Container, Box, Fade } from '@mui/material';
import styles from './page.module.css';
import { LineChart } from '@mui/x-charts/LineChart';
import BasicCard from './card.js';
import LabelAvatar from '@/app/components/labelAvatar.js';
import { Box, Container, Grid } from '@mui/material';
import { BarChart } from '@mui/x-charts/BarChart';
import { axisClasses } from '@mui/x-charts';
import dayjs, { Dayjs } from 'dayjs';
import BasicCard from './card.js';
import styles from './page.module.css';

import { PieChart, pieArcLabelClasses, pieArcClasses } from '@mui/x-charts/PieChart';
import { useTheme } from '@mui/material/styles';
import React, { useState, useEffect, useRef } from 'react';
import moment from 'moment';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import React, { useEffect } from 'react';

import useSWR from 'swr';

Expand All @@ -39,8 +34,8 @@ export default function Analytics() {
let tempTotal = 0;
let tempDaily = 0;
let tempDailyOrders = 0;
let labels: any = {};
let values: any = [];
const labels: any = {};
const values: any = [];

for (const order of data.orders) {
//(order);
Expand All @@ -59,11 +54,11 @@ export default function Analytics() {
};

const pieChart = async () => {
let labels: any = {};
const labels: any = {};

if (isLoading == false && !error) {
data2 = [];
let filteredOrders = data.orders.filter((a: any) => {
const filteredOrders = data.orders.filter((a: any) => {
return dayjs(currentDaySelected).isSame(dayjs(a.createdAt), 'day');
});

Expand Down Expand Up @@ -102,7 +97,7 @@ export default function Analytics() {
});

return (
<Container>
<Container sx={{ mt: '2%' }}>
<Box sx={{ position: 'absolute', top: 10, right: '30%' }}>
<LocalizationProvider dateAdapter={AdapterDayjs}>
<DatePicker
Expand Down
16 changes: 4 additions & 12 deletions src/app/(header)/admin/calendar/page.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
'use client';
import { Box, Card, Container, Grid } from '@mui/material';
import useSWR from 'swr';
import FullCalendar from '@fullcalendar/react';
import dayGridPlugin from '@fullcalendar/daygrid'; // a plugin!
import listPlugin from '@fullcalendar/list';
import dayjs, { Dayjs } from 'dayjs';

import moment from 'moment';

import React, { useState, useEffect, useRef } from 'react';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import FullCalendar from '@fullcalendar/react';
import { Box, Container } from '@mui/material';
import useSWR from 'swr';

const fetcher = (url: any) => fetch(url).then((res) => res.json());

import LabelAvatar from '@/app/components/labelAvatar';
import { AnyARecord } from 'dns';
export default function Home() {
const { data, error, isLoading } = useSWR('/api/cal', fetcher, { refreshInterval: 1000 });

Expand All @@ -29,7 +21,7 @@ export default function Home() {
}

return (
<Box>
<Box sx={{ mt: '2%' }}>
<Container sx={{ height: '80vh' }}>
<FullCalendar
height="100%"
Expand Down
89 changes: 33 additions & 56 deletions src/app/(header)/admin/menu/page.tsx
Original file line number Diff line number Diff line change
@@ -1,71 +1,48 @@
'use client';
import {
Grid,
Alert,
Avatar,
Container,
Typography,
IconButton,
Box,
Button,
Card,
CardHeader,
CardContent,
TextField,
CardHeader,
Checkbox,
ListItemText,
ListItemIcon,
FormControlLabel,
List,
ListItem,
Divider,
InputAdornment,
Box,
Chip,
CircularProgress,
Container,
Fab,
FormControl,
FormControlLabel,
FormGroup,
Switch,
OutlinedInput,
Chip,
Grid,
IconButton,
InputAdornment,
InputLabel,
Select,
MenuItem,
List,
ListItem,
ListItemAvatar,
CircularProgress,
Button,
ListItemIcon,
ListItemText,
MenuItem,
OutlinedInput,
Select,
SelectChangeEvent,
Alert,
Switch,
TextField,
Typography,
} from '@mui/material';
import { Masonry } from '@mui/lab';
import ImageList from '@mui/material/ImageList';
import ImageListItem from '@mui/material/ImageListItem';

import styles from './page.module.css';
import React, { useState, useEffect, useRef } from 'react';
import EditIcon from '@mui/icons-material/Edit';
import DeleteIcon from '@mui/icons-material/DeleteOutlined';
import SaveIcon from '@mui/icons-material/Save';
import CancelIcon from '@mui/icons-material/Close';
import { Folder, Delete, Add } from '@mui/icons-material';
import LabelAvatar from '@/app/components/labelAvatar';

import { Add, Delete } from '@mui/icons-material';
import SearchIcon from '@mui/icons-material/Search';
import React, { useEffect, useRef, useState } from 'react';

import useSWR from 'swr';
import axios from 'axios';
import MoreVertIcon from '@mui/icons-material/MoreVert';
import {
GridRowsProp,
GridRowModesModel,
GridRowModes,
DataGrid,
GridColDef,
GridRenderCellParams,
GridToolbarContainer,
GridActionsCellItem,
GridEventListener,
GridRowId,
GridRowModel,
GridRowEditStopReasons,
} from '@mui/x-data-grid';
import { useTheme } from '@mui/material/styles';
import { DataGrid, GridColDef } from '@mui/x-data-grid';
import axios from 'axios';
import moment from 'moment';
import useSWR from 'swr';

const fetcher = (url: any) => fetch(url).then((res) => res.json());

Expand Down Expand Up @@ -207,7 +184,7 @@ export default function Home() {
}
});
} else if (windowTitle == 'New Item') {
let temp = Object.assign({}, SelectedItem);
const temp = Object.assign({}, SelectedItem);
temp._id = temp.friendlyName.replace(/\s+/g, '-').toLowerCase();

await axios.post('/api/dishes', temp).then((response) => {
Expand All @@ -224,7 +201,7 @@ export default function Home() {
};

const newOption = () => {
let temp = Object.assign([], SelectedItem.options);
const temp = Object.assign([], SelectedItem.options);

temp.push(blankOption);

Expand Down Expand Up @@ -399,8 +376,8 @@ export default function Home() {
};

const handleSpecificOptionUpdate = (option_id: any, value: any, text: any) => {
let theItem = Object.assign({}, SelectedItem);
let index = theItem.options.findIndex((option: any) => option._id == option_id);
const theItem = Object.assign({}, SelectedItem);
const index = theItem.options.findIndex((option: any) => option._id == option_id);

for (const option of theItem.options) {
if (index != -1) {
Expand Down Expand Up @@ -524,7 +501,7 @@ export default function Home() {
};

return (
<Box>
<Box sx={{ mt: '2%' }}>
<Box sx={{ position: 'absolute', top: '0', right: '0', mt: ' 6%', mr: '15%', zIndex: '10' }}>
<AlertComponent></AlertComponent>
</Box>
Expand Down Expand Up @@ -565,7 +542,7 @@ export default function Home() {
</Grid>
</Grid>

<Grid container direction="row" sx={{ height: '78vh', overflowY: 'scroll' }} spacing={3}>
<Grid container direction="row" sx={{ height: '82vh', overflowY: 'scroll' }} spacing={3}>
<RenderCards></RenderCards>

{!open ? (
Expand Down
34 changes: 16 additions & 18 deletions src/app/(header)/admin/scratch/PD/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
'use client'
import { Grid } from "@mui/material";
import FullCalendar from '@fullcalendar/react'
import dayGridPlugin from '@fullcalendar/daygrid' // a plugin!
'use client';
import FullCalendar from '@fullcalendar/react';
import dayGridPlugin from '@fullcalendar/daygrid'; // a plugin!

export default function personalPD(){
return (
<FullCalendar
plugins={[ dayGridPlugin ]}
initialView="dayGridMonth"
weekends={false}
events={[
{ title: 'taco tuesday', date: '2023-10-30' },
{ title: 'first event!!', date: '2023-10-30' }
]}
/>
);

}
export default function personalPD() {
return (
<FullCalendar
plugins={[dayGridPlugin]}
initialView="dayGridMonth"
weekends={false}
events={[
{ title: 'taco tuesday', date: '2023-10-30' },
{ title: 'first event!!', date: '2023-10-30' },
]}
/>
);
}
4 changes: 1 addition & 3 deletions src/app/(header)/admin/staff/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
'use client';
import { Grid, Avatar, Container, Typography, Chip } from '@mui/material';
import { Grid, Avatar, Container, Chip } from '@mui/material';
import styles from './page.module.css';
import LabelAvatar from '@/app/components/labelAvatar';
import {
DataGrid,
GridRowsProp,
GridColDef,
gridClasses,
GridToolbar,
GridToolbarColumnsButton,
GridToolbarContainer,
GridToolbarExport,
GridCsvExportOptions,
GridToolbarDensitySelector,
} from '@mui/x-data-grid';

Expand Down
1 change: 0 additions & 1 deletion src/app/(header)/kitchen_display/actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use server';

import { Any } from '@react-spring/web';
export const connect = async (ePosDev: any, ePosDevice: any, PRINTER_IP: any, printerPort: any) => {
//setConnectionStatus('Connecting ...');
console.log(ePosDev);
Expand Down
Loading

0 comments on commit 0692c34

Please sign in to comment.