Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

60 bug batch 2 frontend #64

Merged
merged 3 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading