Skip to content

Commit

Permalink
60 bug batch 2 frontend (#64)
Browse files Browse the repository at this point in the history
* commented out catalog edit button.

* commented out edit button logic

---------

Co-authored-by: michellelin1 <[email protected]>
  • Loading branch information
Philip-Jian and michellelin1 authored Mar 21, 2024
1 parent 0e5bd9a commit 662d4e4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"react-icons": "^5.0.1",
"react-router-dom": "^6.20.0",
"react-script": "^2.0.5",
"react-icons": "^5.0.1",
"yup": "^1.3.2"
},
"lint-staged": {
Expand Down
12 changes: 6 additions & 6 deletions src/components/Catalog/CatalogTable.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Container, Badge, IconButton, Table, Thead, Tr, Th, Td, Tbody } from '@chakra-ui/react';
import { EditIcon, DeleteIcon } from '@chakra-ui/icons';
import { /*EditIcon,*/ DeleteIcon } from '@chakra-ui/icons'; // add 'EditIcon' to reinstate edit button.
import s from './Catalog.module.css';
import PropTypes from 'prop-types';

const CatalogTable = ({ tableData, handleEditForm, handleDeleteClick }) => {
const CatalogTable = ({ tableData, /*handleEditForm,*/ handleDeleteClick }) => {
return (
<Table variant="simple" className={s['catalog-table']} borderWidth="0" width="100%" px="1rem">
<Thead>
Expand All @@ -15,7 +15,7 @@ const CatalogTable = ({ tableData, handleEditForm, handleDeleteClick }) => {
</Tr>
</Thead>
<Tbody>
{tableData.map(({ id, host, title, eventType, subject, year, season, description }) => (
{tableData.map(({ id, host, title, eventType, subject, year, season/*, description*/ }) => (
<Tr key={id}>
<Td textAlign="left" py="1.5rem">
{title}
Expand Down Expand Up @@ -80,7 +80,7 @@ const CatalogTable = ({ tableData, handleEditForm, handleDeleteClick }) => {
</Container>
</Td>
<Td>
<IconButton
{/* <IconButton
color="gray.400"
backgroundColor="transparent"
p="0.5rem"
Expand All @@ -98,7 +98,7 @@ const CatalogTable = ({ tableData, handleEditForm, handleDeleteClick }) => {
description,
})
}
/>
/> */}
<IconButton
color="gray.400"
backgroundColor="transparent"
Expand All @@ -118,7 +118,7 @@ const CatalogTable = ({ tableData, handleEditForm, handleDeleteClick }) => {

CatalogTable.propTypes = {
tableData: PropTypes.arrayOf(PropTypes.any),
handleEditForm: PropTypes.func.isRequired,
// handleEditForm: PropTypes.func.isRequired,
handleDeleteClick: PropTypes.func.isRequired,
};

Expand Down
26 changes: 13 additions & 13 deletions src/pages/Catalog/Catalog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import {

export default function Catalog() {
const { isOpen: isDeleteOpen, onOpen: onDeleteOpen, onClose: onDeleteClose } = useDisclosure();
const {
isOpen: isEditFormOpen,
onOpen: onEditFormOpen,
onClose: onEditFormClose,
} = useDisclosure();
// const {
// isOpen: isEditFormOpen,
// onOpen: onEditFormOpen,
// onClose: onEditFormClose,
// } = useDisclosure();
const {
isOpen: isCreateFormOpen,
onOpen: onCreateFormOpen,
Expand All @@ -45,7 +45,7 @@ export default function Catalog() {
const [dataShouldRevalidate, setDataShouldRevalidate] = useState(false);
const [totalRowCount, setTotalRowCount] = useState(0);
const [deleteItemId, setDeleteItemId] = useState(-1);
const [editData, setEditData] = useState({});
// const [editData, setEditData] = useState({});
const [searchTerm, setSearchTerm] = useState('');

const { filters, clearFilters, filterValues } = useSearchFilters();
Expand All @@ -56,10 +56,10 @@ export default function Catalog() {
pagesCount: Math.ceil(totalRowCount / 10),
});

const handleEditForm = data => {
setEditData(data);
onEditFormOpen();
};
// const handleEditForm = data => {
// setEditData(data);
// onEditFormOpen();
// };

const handleDeleteClick = id => {
setDeleteItemId(id);
Expand Down Expand Up @@ -186,7 +186,7 @@ export default function Catalog() {
>
<CatalogTable
tableData={tableData}
handleEditForm={handleEditForm}
// handleEditForm={handleEditForm}
handleDeleteClick={handleDeleteClick}
/>
<PaginationFooter
Expand All @@ -204,12 +204,12 @@ export default function Catalog() {
onClose={onCreateFormClose}
setDataShouldRevalidate={setDataShouldRevalidate}
/>
<CreateEventFormModal
{/* <CreateEventFormModal
isOpen={isEditFormOpen}
onClose={onEditFormClose}
eventData={editData}
setDataShouldRevalidate={setDataShouldRevalidate}
/>
/> */}
<DeleteEventModal
isOpen={isDeleteOpen}
onClose={onDeleteClose}
Expand Down

0 comments on commit 662d4e4

Please sign in to comment.