-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* getting started * cleannup * Make it work * mark as breaking 4.0 change * cleanup * fix build and types * update docs * guarantee limit and file size always exist with backfill/upscale/I need a better name for this * wire up file limit path, still haven't implemented lol * parseAndExpandInputConfig rename * file limits working with mime-types as our first dep :( * Fix copy for button labels, add /sink * maybe this will fix test builds * versioning is annoying * clean up stale comments * More pluralizations * Typed counts
- Loading branch information
Showing
16 changed files
with
399 additions
and
112 deletions.
There are no files selected for viewing
This file contains 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,6 @@ | ||
--- | ||
"uploadthing": major | ||
"@uploadthing/react": major | ||
--- | ||
|
||
Overhauled file router syntax |
This file contains 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 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 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 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,55 @@ | ||
"use client"; | ||
|
||
import { Inter } from "next/font/google"; | ||
import { UploadButton, UploadDropzone } from "@uploadthing/react"; | ||
import type { OurFileRouter } from "../_uploadthing"; | ||
|
||
const inter = Inter({ subsets: ["latin"] }); | ||
|
||
export default function Home() { | ||
return ( | ||
<main className="flex min-h-screen flex-col items-center justify-center gap-16 p-24"> | ||
<div className="flex flex-col items-center justify-center gap-4"> | ||
<div className="flex gap-4"> | ||
<UploadButton<OurFileRouter> | ||
endpoint="withoutMdwr" | ||
onClientUploadComplete={(res) => { | ||
console.log("Files: ", res); | ||
alert("Upload Completed"); | ||
}} | ||
onUploadError={(error: Error) => { | ||
alert(`ERROR! ${error.message}`); | ||
}} | ||
/> | ||
|
||
<UploadButton<OurFileRouter> | ||
endpoint="videoAndImage" | ||
onClientUploadComplete={(res) => { | ||
console.log("Files: ", res); | ||
alert("Upload Completed"); | ||
}} | ||
onUploadError={(error: Error) => { | ||
alert(`ERROR! ${error.message}`); | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
<div className="flex flex-col items-center justify-center gap-4"> | ||
<span className="text-4xl font-bold text-center"> | ||
{`...or using a dropzone:`} | ||
</span> | ||
<UploadDropzone<OurFileRouter> | ||
endpoint="withoutMdwr" | ||
onClientUploadComplete={(res) => { | ||
// Do something with the response | ||
console.log("Files: ", res); | ||
alert("Upload Completed"); | ||
}} | ||
onUploadError={(error: Error) => { | ||
alert(`ERROR! ${error.message}`); | ||
}} | ||
/> | ||
</div> | ||
</main> | ||
); | ||
} |
This file contains 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 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 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 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 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
Oops, something went wrong.
91fb166
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs-uploadthing – ./
docs-uploadthing-pinglabs.vercel.app
uploadthing-1m3c.vercel.app
docs-uploadthing-git-main-pinglabs.vercel.app
docs.uploadthing.com