-
-
-
-
+
+
setIsFullScreen(true)}
+ className="cursor-zoom-in rounded-lg w-[500px]"
+ />
{/* Navigation arrows */}
{artifacts.length > 1 && (
<>
@@ -65,6 +66,25 @@ const ListingImageFlipper = (props: Props) => {
>
)}
+
+ {isFullScreen && (
+
setIsFullScreen(false)}
+ >
+
+
+
+ )}
>
);
};
diff --git a/frontend/src/components/listing/ListingImageGallery.tsx b/frontend/src/components/listing/ListingImageGallery.tsx
index 529b1d67..ac550acf 100644
--- a/frontend/src/components/listing/ListingImageGallery.tsx
+++ b/frontend/src/components/listing/ListingImageGallery.tsx
@@ -17,39 +17,6 @@ interface Props {
listingId: string;
}
-const FullScreenImage = ({
- artifact,
- onClose,
-}: {
- artifact: Artifact;
- onClose: () => void;
-}) => {
- return (
-
{
- if (e.target === e.currentTarget) {
- onClose();
- }
- }}
- >
-
-
-
-
-
- );
-};
-
const ListingImageItem = ({
artifact,
index,
@@ -59,7 +26,6 @@ const ListingImageItem = ({
setArtifacts,
setCurrentImageIndex,
listingId,
- onFullScreen,
}: {
artifact: Artifact;
index: number;
@@ -69,7 +35,6 @@ const ListingImageItem = ({
setArtifacts: (artifacts: Artifact[]) => void;
setCurrentImageIndex: React.Dispatch
>;
listingId: string;
- onFullScreen: (artifact: Artifact) => void;
}) => {
const [isDeleting, setIsDeleting] = useState(false);
const [isUpdating, setIsUpdating] = useState(false);
@@ -160,10 +125,7 @@ const ListingImageItem = ({
className={`aspect-square rounded-lg overflow-hidden cursor-pointer relative ${
currentImageIndex === index ? "ring-2 ring-blue-500" : ""
} ${artifact.is_main ? "ring-2 ring-green-500" : ""}`}
- onClick={() => {
- setCurrentImageIndex(index);
- onFullScreen(artifact);
- }}
+ onClick={() => setCurrentImageIndex(index)}
>
{canEdit && (
@@ -206,19 +168,8 @@ const ListingImageGallery = ({ listingId, ...props }: Props) => {
canEdit,
} = props;
- const [fullScreenArtifact, setFullScreenArtifact] = useState(
- null,
- );
-
return (
<>
- {fullScreenArtifact && (
- setFullScreenArtifact(null)}
- />
- )}
-
{artifacts.length > 0 ? (
{artifacts.map((artifact, index) => (
@@ -232,7 +183,6 @@ const ListingImageGallery = ({ listingId, ...props }: Props) => {
artifacts={artifacts}
setArtifacts={setArtifacts}
setCurrentImageIndex={setCurrentImageIndex}
- onFullScreen={setFullScreenArtifact}
/>
))}
diff --git a/frontend/src/components/listing/ListingOnshape.tsx b/frontend/src/components/listing/ListingOnshape.tsx
index 9a2793e2..72ca79a0 100644
--- a/frontend/src/components/listing/ListingOnshape.tsx
+++ b/frontend/src/components/listing/ListingOnshape.tsx
@@ -384,7 +384,7 @@ const ListingOnshape = (props: Props) => {
Upload your URDF file:
diff --git a/frontend/src/components/listing/ListingRegisterRobot.tsx b/frontend/src/components/listing/ListingRegisterRobot.tsx
index dc027abd..727cd1a8 100644
--- a/frontend/src/components/listing/ListingRegisterRobot.tsx
+++ b/frontend/src/components/listing/ListingRegisterRobot.tsx
@@ -9,9 +9,10 @@ import { RegisterRobotModal } from "../modals/RegisterRobotModal";
interface Props {
listingId: string;
+ className?: string;
}
-const ListingRegisterRobot = ({ listingId }: Props) => {
+const ListingRegisterRobot = ({ listingId, className }: Props) => {
const [isRegisterModalOpen, setIsRegisterModalOpen] = useState(false);
const { isAuthenticated, currentUser } = useAuthentication();
@@ -25,7 +26,7 @@ const ListingRegisterRobot = ({ listingId }: Props) => {