Skip to content

Commit 6a5af82

Browse files
fix thumbnail on placeholder
1 parent c626251 commit 6a5af82

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

apps/web/app/(org)/dashboard/caps/UploadingContext.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export type UploadState =
3333
status: "uploadingVideo";
3434
capId: string;
3535
progress: number;
36+
thumbnailUrl: string | undefined;
3637
};
3738

3839
const UploadingContext = createContext<UploadingContextType | undefined>(

apps/web/app/(org)/dashboard/caps/components/UploadCapButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,10 @@ export const UploadCapButton = ({
310310
if (event.lengthComputable) {
311311
const percent = (event.loaded / event.total) * 100;
312312
setState({
313-
status: "uploadingThumbnail",
313+
status: "uploadingVideo",
314314
capId: uploadId,
315315
progress: percent,
316+
thumbnailUrl: thumbnailUrl,
316317
});
317318

318319
setUploadState({

apps/web/app/(org)/dashboard/caps/components/UploadPlaceholderCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ export const UploadPlaceholderCard = () => {
2222
return (
2323
<div className="flex flex-col gap-4 w-full h-full rounded-xl bg-gray-1 border-gray-3 border-[1px]">
2424
<div className="overflow-hidden relative w-full bg-black rounded-t-xl border-b border-gray-3 aspect-video group">
25-
{/*{uploadingThumbnailUrl ? (
25+
{state.status === "uploading" ? (
2626
<img
27-
src={uploadingThumbnailUrl}
27+
src={state.thumbnailUrl}
2828
alt="Uploading thumbnail"
2929
className="object-cover w-full h-full"
3030
/>
3131
) : (
3232
<div className="flex justify-center items-center w-full h-full">
3333
<LogoSpinner className="w-8 h-8 animate-spin" />
3434
</div>
35-
)}*/}
35+
)}
3636

3737
<div className="absolute inset-0 transition-all duration-300 bg-black/60"></div>
3838

0 commit comments

Comments
 (0)