cloudinary-community / cloudinary-examples

Easy Cloudinary integration examples for boosting web performance.
MIT License
88 stars 79 forks source link

Feat/upgrade clduploadwidget signed and captions #165

Closed max-programming closed 2 months ago

max-programming commented 4 months ago

This pull request includes upgrading two examples

vercel[bot] commented 4 months ago

@max-programming is attempting to deploy a commit to the Cloudinary DevX Team on Vercel.

A member of the Team first needs to authorize it.

colbyfayock commented 4 months ago

hey @max-programming this is looking good, push a few style/cleanup tweaks

i think the only thing id like a little different is the app router Uploader component

the recommendation that I've been using to get around the client components is to create a light wrapper around the component

see example: https://next.cloudinary.dev/nextjs-14#app-router-app

I think that would be preferable so that you can includ the result UI inside of the page file simlar to what you have in the pages directory

wdyt?

max-programming commented 4 months ago

@colbyfayock The reason I did not create a wrapper component for both CldUploadWidget and CldImage is because there's useState being used. Which eventually needs a "use client" on top. So if we remove the <Uploader /> component and use the wrappers directly in page.tsx, we'd still have to put "use client" at the top of page.tsx (which is not the right thing to do)

So I put them together inside one client component.

colbyfayock commented 3 months ago

@max-programming got it makes sense, could we then use the same <Uploader component in both examples then for consistency? currently its only used for the App Router

max-programming commented 3 months ago

@colbyfayock Done ✅

colbyfayock commented 2 months ago

looks great, thanks @max-programming