Fix Build
This commit is contained in:
@@ -18,25 +18,31 @@ const navConfig = [
|
||||
// GENERAL
|
||||
// ----------------------------------------------------------------------
|
||||
{
|
||||
subheader: 'general v3.2.0',
|
||||
items: [
|
||||
{ title: 'Dashboard', path: '/dashboard', icon: ICONS.dashboard },
|
||||
],
|
||||
},
|
||||
|
||||
// MANAGEMENT
|
||||
// Membership
|
||||
// ----------------------------------------------------------------------
|
||||
{
|
||||
subheader: 'Management',
|
||||
subheader: 'Membership',
|
||||
items: [
|
||||
{
|
||||
title: 'Master Data',
|
||||
// path: '/',
|
||||
title: 'Member List',
|
||||
path: '/members',
|
||||
icon: ICONS.user,
|
||||
children: [
|
||||
{ title: 'Obat', path: '/medicines' },
|
||||
],
|
||||
},
|
||||
// {
|
||||
// title: 'Member Movement',
|
||||
// // path: '/',
|
||||
// icon: ICONS.user,
|
||||
// children: [
|
||||
// { title: '', path: '/medicines' },
|
||||
// { title: 'Obat', path: '/medicines' },
|
||||
// { title: 'Obat', path: '/medicines' },
|
||||
// ],
|
||||
// },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
// @mui
|
||||
import { Button, Container, Typography } from '@mui/material';
|
||||
// hooks
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
// components
|
||||
import Page from '../../components/Page';
|
||||
import axios from '../../utils/axios';
|
||||
import useAuth from '../../hooks/useAuth';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
export default function PageOne() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const { logout } = useAuth();
|
||||
|
||||
const loadSomething = () => {
|
||||
console.log('Loading Something')
|
||||
}
|
||||
|
||||
return (
|
||||
<Page title="Obat">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Typography variant="h3" component="h1" paragraph>
|
||||
Daftar Obat
|
||||
</Typography>
|
||||
<Typography>askdnkasndka jsndkajsndkajsdnkajsndk jansdkasjdnkjansd</Typography>
|
||||
<Button onClick={loadSomething}>Something</Button>
|
||||
<Link to='/medicines/create'>asdasdasd</Link>
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
159
frontend/client-portal/src/pages/Members/Index.tsx
Normal file
159
frontend/client-portal/src/pages/Members/Index.tsx
Normal file
@@ -0,0 +1,159 @@
|
||||
// @mui
|
||||
import { Box, Button, Collapse, Container, IconButton, Paper, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from '@mui/material';
|
||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||
import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
|
||||
// hooks
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
// components
|
||||
import Page from '../../components/Page';
|
||||
import axios from '../../utils/axios';
|
||||
import useAuth from '../../hooks/useAuth';
|
||||
import { Link } from 'react-router-dom';
|
||||
import React from 'react';
|
||||
|
||||
export default function Members() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const { logout } = useAuth();
|
||||
|
||||
const loadSomething = () => {
|
||||
console.log('Loading Something')
|
||||
}
|
||||
|
||||
function createData(
|
||||
name: string,
|
||||
calories: number,
|
||||
fat: number,
|
||||
carbs: number,
|
||||
protein: number,
|
||||
price: number,
|
||||
) {
|
||||
return {
|
||||
name,
|
||||
calories,
|
||||
fat,
|
||||
carbs,
|
||||
protein,
|
||||
price,
|
||||
history: [
|
||||
{
|
||||
date: '2020-01-05',
|
||||
customerId: '11091700',
|
||||
amount: 3,
|
||||
},
|
||||
{
|
||||
date: '2020-01-02',
|
||||
customerId: 'Anonymous',
|
||||
amount: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
function Row(props: { row: ReturnType<typeof createData> }) {
|
||||
const { row } = props;
|
||||
const [open, setOpen] = React.useState(false);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<TableRow sx={{ '& > *': { borderBottom: 'unset' } }}>
|
||||
<TableCell>
|
||||
<IconButton
|
||||
aria-label="expand row"
|
||||
size="small"
|
||||
onClick={() => setOpen(!open)}
|
||||
>
|
||||
{open ? <KeyboardArrowDownIcon /> : <KeyboardArrowRightIcon />}
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
<TableCell component="th" scope="row">
|
||||
{row.name}
|
||||
</TableCell>
|
||||
<TableCell align="right">{row.calories}</TableCell>
|
||||
<TableCell align="right">{row.fat}</TableCell>
|
||||
<TableCell align="right">{row.carbs}</TableCell>
|
||||
<TableCell align="right">{row.protein}</TableCell>
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<TableCell style={{ paddingBottom: 0, paddingTop: 0 }} colSpan={6}>
|
||||
<Collapse in={open} timeout="auto" unmountOnExit>
|
||||
<Box sx={{ margin: 1 }}>
|
||||
<Typography variant="h6" gutterBottom component="div">
|
||||
History
|
||||
</Typography>
|
||||
<Table size="small" aria-label="purchases">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell>Date</TableCell>
|
||||
<TableCell>Customer</TableCell>
|
||||
<TableCell align="right">Amount</TableCell>
|
||||
<TableCell align="right">Total price ($)</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{row.history.map((historyRow) => (
|
||||
<TableRow key={historyRow.date}>
|
||||
<TableCell component="th" scope="row">
|
||||
{historyRow.date}
|
||||
</TableCell>
|
||||
<TableCell>{historyRow.customerId}</TableCell>
|
||||
<TableCell align="right">{historyRow.amount}</TableCell>
|
||||
<TableCell align="right">
|
||||
{Math.round(historyRow.amount * row.price * 100) / 100}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</Box>
|
||||
</Collapse>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
// Dummy Default Data
|
||||
const rows = [
|
||||
createData('Frozen yoghurt', 159, 6.0, 24, 4.0, 3.99),
|
||||
createData('Ice cream sandwich', 237, 9.0, 37, 4.3, 4.99),
|
||||
createData('Eclair', 262, 16.0, 24, 6.0, 3.79),
|
||||
createData('Cupcake', 305, 3.7, 67, 4.3, 2.5),
|
||||
createData('Gingerbread', 356, 16.0, 49, 3.9, 1.5),
|
||||
];
|
||||
|
||||
return (
|
||||
<Page title="Member List">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<Typography variant="h3" component="h1" paragraph>
|
||||
Member List
|
||||
</Typography>
|
||||
|
||||
|
||||
<Typography variant="body1" component="p" paragraph>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quaerat, delectus? Suscipit placeat tempora mollitia optio, assumenda maiores architecto officia itaque molestias cum id eligendi necessitatibus! A velit eos ratione ullam.
|
||||
</Typography>
|
||||
|
||||
<TableContainer component={Paper}>
|
||||
<Table aria-label="collapsible table">
|
||||
<TableHead>
|
||||
<TableRow>
|
||||
<TableCell />
|
||||
<TableCell>Dessert (100g serving)</TableCell>
|
||||
<TableCell align="right">Calories</TableCell>
|
||||
<TableCell align="right">Fat (g)</TableCell>
|
||||
<TableCell align="right">Carbs (g)</TableCell>
|
||||
<TableCell align="right">Protein (g)</TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{rows.map((row, index) => (
|
||||
<Row key={index} row={row} />
|
||||
))}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</TableContainer>
|
||||
</Container>
|
||||
</Page>
|
||||
);
|
||||
}
|
||||
@@ -70,18 +70,15 @@ export default function Router() {
|
||||
</AuthGuard>
|
||||
</AuthProvider>),
|
||||
children:[
|
||||
{ element: <Navigate to="/dashboard" replace />, index: true },
|
||||
{
|
||||
path: 'dashboard',
|
||||
element: <Dashboard />,
|
||||
},
|
||||
// {
|
||||
// path: 'medicines',
|
||||
// element: <AuthProvider><Medicines /></AuthProvider>,
|
||||
// },
|
||||
// {
|
||||
// path: 'medicines/create',
|
||||
// element: <AuthProvider><MedicinesCreate /></AuthProvider>
|
||||
// },
|
||||
{
|
||||
path: 'members',
|
||||
element: <Members />,
|
||||
},
|
||||
]
|
||||
},
|
||||
// {
|
||||
@@ -123,6 +120,6 @@ const Login = Loadable(lazy(() => import('../pages/auth/Login')));
|
||||
const Dashboard = Loadable(lazy(() => import('../pages/Dashboard')));
|
||||
const NotFound = Loadable(lazy(() => import('../pages/Page404')));
|
||||
|
||||
// Medicines
|
||||
const Medicines = Loadable(lazy(() => import('../pages/Medicines/Index')));
|
||||
// Members
|
||||
const Members = Loadable(lazy(() => import('../pages/Members/Index')));
|
||||
const MedicinesCreate = Loadable(lazy(() => import('../pages/Medicines/Create')));
|
||||
|
||||
Reference in New Issue
Block a user