Skip to content

Commit

Permalink
edited code for removing image upload (#214)
Browse files Browse the repository at this point in the history
* edited code for removing image upload

* removed image upload options but commented out instead of deleted

* linting fixes

* linting fixes pt 2

---------

Co-authored-by: Kate Bicalho <katebicalho@kates-mbp-5.wifi.local.cmu.edu>
Co-authored-by: Michelle Li <michellejli7777@gmail.com>
  • Loading branch information
3 people authored Mar 23, 2024
1 parent 55d8219 commit 29acdcf
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
16 changes: 8 additions & 8 deletions client/src/components/AddItemButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ function AddItemButton(props: {
const handleRadioChange = (e: any, { name, value }: any) => {
setState({ ...state, [name]: value === "true" });
};
const handleFileChange = (
e: React.ChangeEvent<HTMLInputElement>,
{ name, value }: any
) => {
setState({ ...state, [name]: value, imageObject: e?.target?.files?.[0] });
};
// const handleFileChange = (
// e: React.ChangeEvent<HTMLInputElement>,
// { name, value }: any
// ) => {
// setState({ ...state, [name]: value, imageObject: e?.target?.files?.[0] });
// };

const uploadImage = (imageFile: File) => {
const imageName = "test";
Expand Down Expand Up @@ -551,13 +551,13 @@ function AddItemButton(props: {
onChange={handleChange}
error={buildingError}
/>
<Form.Input
{/* <Form.Input
label="Image Upload"
name="imagePath"
type="file"
value={state.imagePath}
onChange={handleFileChange}
/>
/> */}
{state.identifiable ? (
<Form.Group widths="equal">
<Form.Input
Expand Down
20 changes: 10 additions & 10 deletions client/src/components/EditItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ function EditItem(props: {
const handleRadioChange = (e: any, { name, value }: any) => {
setState({ ...state, [name]: value === "true" });
};
const handleFileChange = (
e: React.ChangeEvent<HTMLInputElement>,
{ name, value }: any
) => {
console.log("handling file change");
console.log(name + " " + value);
setState({ ...state, [name]: value, imageObject: e?.target?.files?.[0] });
};
// const handleFileChange = (
// e: React.ChangeEvent<HTMLInputElement>,
// { name, value }: any
// ) => {
// console.log("handling file change");
// console.log(name + " " + value);
// setState({ ...state, [name]: value, imageObject: e?.target?.files?.[0] });
// };

const uploadImage = (imageFile: File) => {
console.log("attempting to edit image");
Expand Down Expand Up @@ -404,13 +404,13 @@ function EditItem(props: {
onChange={handleChange}
/>
</Form.Group>
<Form.Input
{/* <Form.Input
label="Image Upload"
name="imagePath"
type="file"
value={state.imagePath}
onChange={handleFileChange}
/>
/> */}
{state.identifiable ? (
<Form.Group widths="equal">
<Form.Input
Expand Down
10 changes: 5 additions & 5 deletions client/src/components/TableWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import ApproveSwitch from "./ApproveSwitch";
import AvailableSwitch from "./AvailableSwitch";
import EditButton from "./EditItem";
import HistoryAccordion from "./HistoryAccordion";
import ImageModal from "./ImageModal";
// import ImageModal from "./ImageModal";
import PublicDisplaySwitch from "./PublicDisplaySwitch";
import UnarchiveButton from "./UnarchiveButton";

Expand Down Expand Up @@ -123,14 +123,14 @@ const TableWidget = (props: {
>
Building
</Table.HeaderCell>
<Table.HeaderCell
{/* <Table.HeaderCell
sorted={
props.sort.column === "image" ? props.sort.direction : undefined
}
onClick={() => changeSort("image")}
>
Image
</Table.HeaderCell>
</Table.HeaderCell> */}
{!props.isArchivedItems && props.isUser ? (
<Table.HeaderCell
sorted={
Expand Down Expand Up @@ -230,9 +230,9 @@ const TableWidget = (props: {
<Table.Cell>{item.whereFound}</Table.Cell>
<Table.Cell>{item.description}</Table.Cell>
<Table.Cell>{item.building}</Table.Cell>
<Table.Cell>
{/* <Table.Cell>
<ImageModal image={item.image}></ImageModal>
</Table.Cell>
</Table.Cell> */}
{!props.isArchivedItems && props.isUser ? (
<Table.Cell>
<PublicDisplaySwitch
Expand Down

0 comments on commit 29acdcf

Please sign in to comment.