Skip to content

Commit

Permalink
quick modify waste row action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgraham4401 committed Oct 11, 2023
1 parent 87977d1 commit a9e053b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 0 additions & 3 deletions client/src/components/Manifest/WasteLine/WasteLineForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,11 @@ export function WasteLineForm({ handleClose, wasteForm, waste, lineNumber }: Was
setValue,
} = wasteMethods;

console.log('errors', errors);

/**
* onSubmit is the callback function for the form submission.
* @param wasteLine the data submitted from the form
*/
const onSubmit = (wasteLine: WasteLine) => {
console.log('new wasteline ', wasteLine);
if (editWasteLineIndex) {
wasteForm.update(editWasteLineIndex, wasteLine); // append the new waste line to the manifest
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { faTimes, faTools } from '@fortawesome/free-solid-svg-icons';
import { faTools, faTrash } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { Manifest } from 'components/Manifest';
import React from 'react';
Expand All @@ -25,21 +25,25 @@ function WasteRowActions({
return (
<div className="d-flex justify-content-between mx-0">
<Button
title={`remove-waste-${index}-button`}
variant="danger"
title={`remove waste row ${index + 1}`}
variant="outline-danger"
style={{ border: 'none' }}
onClick={() => {
wasteForm.remove(index);
}}
>
<FontAwesomeIcon icon={faTimes} />
<FontAwesomeIcon icon={faTrash} />
</Button>
<Button
title={`edit waste row ${index + 1}`}
variant="outline-primary"
style={{ border: 'none' }}
onClick={() => {
setEditWasteLine(index);
toggleWLModal();
}}
>
<FontAwesomeIcon icon={faTools} className="text-light" />
<FontAwesomeIcon icon={faTools} />
</Button>
</div>
);
Expand Down

0 comments on commit a9e053b

Please sign in to comment.