Skip to content

Commit

Permalink
finally implement image and urdf uploading (#239)
Browse files Browse the repository at this point in the history
* finally implement image and urdf uploading

* more wip

* image uploading

* fix tests
  • Loading branch information
codekansas authored Aug 5, 2024
1 parent dab9ec7 commit f681d76
Show file tree
Hide file tree
Showing 10 changed files with 220 additions and 243 deletions.
180 changes: 0 additions & 180 deletions frontend/src/components/listing/EditListingModal.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { buttonVariants } from "components/ui/Button/Button";
import { Input } from "components/ui/Input/Input";
import { Trash2 as RemoveIcon } from "lucide-react";
import {
createContext,
Expand All @@ -17,8 +19,6 @@ import {
useDropzone,
} from "react-dropzone";
import { cn } from "utils";
import { buttonVariants } from "./Button/Button";
import { Input } from "./Input/Input";

type DirectionOptions = "rtl" | "ltr" | undefined;

Expand Down Expand Up @@ -351,3 +351,27 @@ export const FileInput = forwardRef<
});

FileInput.displayName = "FileInput";

export const FileSubmitButton = forwardRef<
HTMLButtonElement,
React.ButtonHTMLAttributes<HTMLButtonElement>
>(({ children, className, ...props }, ref) => {
const { isLOF } = useFileUpload();
return (
<button
ref={ref}
type="button"
disabled={!isLOF}
className={cn(
buttonVariants({ variant: "primary" }),
"w-full",
className,
)}
{...props}
>
{children}
</button>
);
});

FileSubmitButton.displayName = "FileSubmitButton";
Loading

0 comments on commit f681d76

Please sign in to comment.