-
Notifications
You must be signed in to change notification settings - Fork 80
feat: file upload feature #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6242e77
feat: ui changes for files upload
35C4n0r 8c79316
feat: backend changes for file upload
35C4n0r 9dc9fbd
feat: run make gen
35C4n0r b18b5c4
feat: remove package-lock.json
35C4n0r bf2257f
feat: remove ineffectual assignment
35C4n0r d8235dd
feat: update UI to append file path to message box
35C4n0r ae4ebc6
feat: add Checkbox component
35C4n0r e1c39b6
feat: path browserify
35C4n0r 6480c25
Merge branch 'main' into feat-file-upload
35C4n0r 41d3b23
feat: frontend changes
35C4n0r 59af739
feat: backend changes
35C4n0r faf6119
Merge branch 'main' into feat-file-upload
35C4n0r 5437e43
feat: add tests
35C4n0r 3ab209e
chore: improved error ts
35C4n0r bff390c
chore: push missing file
35C4n0r 686b61d
feat: implement file size limit of 10MB and add tests
35C4n0r 12f2c41
Merge branch 'main' into feat-file-upload
35C4n0r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import * as CheckboxPrimitive from "@radix-ui/react-checkbox" | ||
import { Check } from "lucide-react" | ||
|
||
import { cn } from "@/lib/utils" | ||
|
||
function Checkbox({ | ||
className, | ||
...props | ||
}: React.ComponentProps<typeof CheckboxPrimitive.Root>) { | ||
return ( | ||
<CheckboxPrimitive.Root | ||
data-slot="checkbox" | ||
className={cn( | ||
"peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground", | ||
className | ||
)} | ||
{...props} | ||
> | ||
<CheckboxPrimitive.Indicator | ||
data-slot="checkbox-indicator" | ||
className={cn("flex items-center justify-center text-current")} | ||
> | ||
<Check className="h-4 w-4" /> | ||
</CheckboxPrimitive.Indicator> | ||
</CheckboxPrimitive.Root> | ||
) | ||
} | ||
|
||
export { Checkbox } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
import * as DialogPrimitive from "@radix-ui/react-dialog" | ||
import { X } from "lucide-react" | ||
|
||
import { cn } from "@/lib/utils" | ||
|
||
function Dialog({ | ||
...props | ||
}: React.ComponentProps<typeof DialogPrimitive.Root>) { | ||
return <DialogPrimitive.Root data-slot="dialog" {...props} /> | ||
} | ||
|
||
function DialogTrigger({ | ||
...props | ||
}: React.ComponentProps<typeof DialogPrimitive.Trigger>) { | ||
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} /> | ||
} | ||
|
||
function DialogPortal({ | ||
...props | ||
}: React.ComponentProps<typeof DialogPrimitive.Portal>) { | ||
return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} /> | ||
} | ||
|
||
function DialogClose({ | ||
...props | ||
}: React.ComponentProps<typeof DialogPrimitive.Close>) { | ||
return <DialogPrimitive.Close data-slot="dialog-close" {...props} /> | ||
} | ||
|
||
function DialogOverlay({ | ||
className, | ||
...props | ||
}: React.ComponentProps<typeof DialogPrimitive.Overlay>) { | ||
return ( | ||
<DialogPrimitive.Overlay | ||
data-slot="dialog-overlay" | ||
className={cn( | ||
"bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
function DialogContent({ | ||
className, | ||
children, | ||
...props | ||
}: React.ComponentProps<typeof DialogPrimitive.Content>) { | ||
return ( | ||
<DialogPortal> | ||
<DialogOverlay /> | ||
<DialogPrimitive.Content | ||
data-slot="dialog-content" | ||
className={cn( | ||
"bg-background text-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg", | ||
className | ||
)} | ||
{...props} | ||
> | ||
{children} | ||
<DialogPrimitive.Close | ||
data-slot="dialog-close" | ||
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none" | ||
> | ||
<X className="size-4" /> | ||
<span className="sr-only">Close</span> | ||
</DialogPrimitive.Close> | ||
</DialogPrimitive.Content> | ||
</DialogPortal> | ||
) | ||
} | ||
|
||
function DialogHeader({ | ||
className, | ||
...props | ||
}: React.ComponentProps<"div">) { | ||
return ( | ||
<div | ||
data-slot="dialog-header" | ||
className={cn( | ||
"flex flex-col space-y-1.5 text-center sm:text-left", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
function DialogFooter({ | ||
className, | ||
...props | ||
}: React.ComponentProps<"div">) { | ||
return ( | ||
<div | ||
data-slot="dialog-footer" | ||
className={cn( | ||
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
function DialogTitle({ | ||
className, | ||
...props | ||
}: React.ComponentProps<typeof DialogPrimitive.Title>) { | ||
return ( | ||
<DialogPrimitive.Title | ||
data-slot="dialog-title" | ||
className={cn( | ||
"text-lg font-semibold leading-none tracking-tight", | ||
className | ||
)} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
function DialogDescription({ | ||
className, | ||
...props | ||
}: React.ComponentProps<typeof DialogPrimitive.Description>) { | ||
return ( | ||
<DialogPrimitive.Description | ||
data-slot="dialog-description" | ||
className={cn("text-muted-foreground text-sm", className)} | ||
{...props} | ||
/> | ||
) | ||
} | ||
|
||
export { | ||
Dialog, | ||
DialogPortal, | ||
DialogOverlay, | ||
DialogTrigger, | ||
DialogClose, | ||
DialogContent, | ||
DialogHeader, | ||
DialogFooter, | ||
DialogTitle, | ||
DialogDescription, | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.