Skip to content

Commit

Permalink
resolved labels for images
Browse files Browse the repository at this point in the history
  • Loading branch information
stevem-zhou committed Sep 17, 2023
1 parent 4b82504 commit 21981e3
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/components/Home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ export default function Home() {
};
getData();
}, []);
console.log("data", data)

window.onresize = () => {
setScreenWidth(window.screen.width);
Expand Down
27 changes: 27 additions & 0 deletions src/components/ImageContainer/ImageContainer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Image, Flex, Text } from "@chakra-ui/react";

export default function ImageContainer({ image, isresolved }) {
return (
<Flex>
{isresolved && <Flex
backgroundColor={"rgba(255, 123, 0, 0.9)"}
position={"absolute"}
w={282}
justifyContent={"center"}
alignItems={"center"}
marginTop={90}
flexDir={"column"}
>
<Text fontSize={18} as="b" color={"white"} >RETURNED</Text>
<Text fontSize={15} color={"white"} >This item has been returned.</Text>
</Flex>}
<Image
rounded={"lg"}
height={230}
width={282}
objectFit={"cover"}
src={image}
/>
</Flex>
);
}
28 changes: 19 additions & 9 deletions src/components/InfoModal/InfoModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
Text,
Stack,
useColorModeValue,
Image,
Modal,
ModalOverlay,
ModalContent,
Expand All @@ -20,6 +19,7 @@ import { formatDate } from "../../utils";
import { UserAuth } from "../../context/AuthContext";
import DataContext from "../../context/DataContext";
import axios from "axios";
import ImageContainer from "../ImageContainer/ImageContainer";

export default function InfoModal({ setData, isOpen, onClose, props }) {
const [showEmail, setShowEmail] = useState(false);
Expand Down Expand Up @@ -52,7 +52,6 @@ export default function InfoModal({ setData, isOpen, onClose, props }) {
}

const formattedDate = formatDate(new Date(props.date));

return (
<Modal
isOpen={isOpen}
Expand Down Expand Up @@ -109,13 +108,24 @@ export default function InfoModal({ setData, isOpen, onClose, props }) {
{props.name}
</Heading>

<Image
rounded={"lg"}
height={230}
width={282}
objectFit={"cover"}
src={props.image}
/>

<ImageContainer image={props.image} isresolved={props.isresolved}/>
{/* <Flex>
<Flex
backgroundColor={"rgba(245, 44, 44, 0.5)"}
float={"left"}
position={"absolute"}
>
<Text>RESOLVED</Text>
</Flex>
<Image
rounded={"lg"}
height={230}
width={282}
objectFit={"cover"}
src={props.image}
/>
</Flex> */}

<Text
textAlign="center"
Expand Down
1 change: 0 additions & 1 deletion src/components/Map/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ export default function Map({
isHelped: newAddedItem.isHelped,
})
.then((item) => {
console.log("item", item)
const newItem = {
image: newAddedItem.image,
type: newAddedItem.type,
Expand Down

0 comments on commit 21981e3

Please sign in to comment.