I, as the user, should be able to reach a schedule details page which will allow me to see all the classes associated with a schedule.
Acceptance Criteria
WHEN I select on the Schedule card, I should be able to
Dependencies
3, #4 - Authentication must be complete in order for the user to reach this portion of the application, and the home page must also be complete as well.
Dev Notes
ClassCard.js will need to be created.
HHPWs, ItemCard.js
import React from 'react';
import PropTypes from 'prop-types';
import DeleteIcon from '@mui/icons-material/Delete';
import AddIcon from '@mui/icons-material/Add';
import { useRouter } from 'next/router';
import {
IconButton,
Card, Grid, CardContent, Typography,
} from '@mui/material';
import { deleteItemFromOrder, addItemToOrder } from '../../API/OrderItemData';
User Story
I, as the user, should be able to reach a schedule details page which will allow me to see all the classes associated with a schedule.
Acceptance Criteria
WHEN I select on the Schedule card, I should be able to
Dependencies
3, #4 - Authentication must be complete in order for the user to reach this portion of the application, and the home page must also be complete as well.
Dev Notes
function ItemCard({ itemObj, context, orderId, onUpdate, }) { const router = useRouter();
const deleteThisItem = () => { if (window.confirm(
Delete ${itemObj.name}?
)) { const payload = { orderId, orderItemId: itemObj.orderItemId, }; deleteItemFromOrder(payload).then(() => onUpdate()); } };const addItemToThisOrder = () => { const payload = { orderId, itemId: itemObj.id, }; addItemToOrder(payload).then(() => router.push(
/orders/${orderId}
)); };return (
); }
ItemCard.propTypes = { itemObj: PropTypes.shape({ id: PropTypes.number.isRequired, orderItemId: PropTypes.number, name: PropTypes.string.isRequired, price: PropTypes.number.isRequired, }).isRequired, context: PropTypes.string.isRequired, orderId: PropTypes.number.isRequired, onUpdate: PropTypes.func, };
ItemCard.defaultProps = { onUpdate: () => {}, };
export default ItemCard;