From 6cf5e1fdd2949a5c5337ff7a32b0d4db0f02f406 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Tue, 7 Oct 2025 17:51:40 +0300 Subject: [PATCH 1/5] show org name + image on share page --- .../dashboard/_components/Navbar/Items.tsx | 4 +- .../s/[videoId]/_components/ShareHeader.tsx | 56 ++++++++++++++----- apps/web/app/s/[videoId]/page.tsx | 7 +++ apps/web/components/forms/NewOrganization.tsx | 3 +- 4 files changed, 52 insertions(+), 18 deletions(-) diff --git a/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx b/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx index 3a9580287e..684f339ef8 100644 --- a/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx +++ b/apps/web/app/(org)/dashboard/_components/Navbar/Items.tsx @@ -492,9 +492,7 @@ const NavItem = ({ {name}

{extraText && !sidebarCollapsed && ( -

- {extraText} -

+

{extraText}

)} diff --git a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx index 1401f11b8b..460184b37a 100644 --- a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx +++ b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx @@ -3,13 +3,14 @@ import type { userSelectProps } from "@cap/database/auth/session"; import type { videos } from "@cap/database/schema"; import { buildEnv, NODE_ENV } from "@cap/env"; -import { Button } from "@cap/ui"; +import { Avatar, Button } from "@cap/ui"; import { userIsPro } from "@cap/utils"; import { faChevronDown, faLock } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import clsx from "clsx"; import { Check, Copy, Globe2 } from "lucide-react"; import moment from "moment"; +import Image from "next/image"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; import { toast } from "sonner"; @@ -29,7 +30,10 @@ export const ShareHeader = ({ sharedSpaces = [], spacesData = null, }: { - data: typeof videos.$inferSelect; + data: typeof videos.$inferSelect & { + organizationIconUrl?: string | null; + organizationName?: string | null; + }; user: typeof userSelectProps | null; customDomain?: string | null; domainVerified?: boolean; @@ -62,6 +66,8 @@ export const ShareHeader = ({ const isOwner = user && user.id.toString() === data.ownerId; + console.log(data); + const { webUrl } = usePublicEnv(); useEffect(() => { @@ -70,7 +76,9 @@ export const ShareHeader = ({ const handleBlur = async () => { setIsEditing(false); - + if (title === data.name) { + return; + } try { await editTitle(data.id, title); toast.success("Video title updated"); @@ -136,7 +144,7 @@ export const ShareHeader = ({ const renderSharedStatus = () => { const baseClassName = - "text-sm text-gray-10 transition-colors duration-200 flex items-center"; + "text-sm text-gray-10 justify-center lg:justify-start transition-colors duration-200 flex items-center"; if (isOwner) { const hasSpaceSharing = @@ -198,9 +206,29 @@ export const ShareHeader = ({ />
-
-
-
+
+
+
+ {data.organizationIconUrl ? ( + Organization icon + ) : ( + + )} +

+ {data.organizationName} +

+
+
{isEditing ? ( ) : (

)} + {user && renderSharedStatus()} +

+ {moment(data.createdAt).fromNow()} +

- {user && renderSharedStatus()} -

- {moment(data.createdAt).fromNow()} -

{user !== null && ( -
-
+
+
{data.password && ( = (props) => { const formSchema = z.object({ - name: z.string().min(1), + name: z.string().min(1).max(25), }); const form = useForm>({ @@ -77,6 +77,7 @@ export const NewOrganization: React.FC = (props) => { render={({ field }) => ( { From 87021b082a6f3cb37368e0416e29170c177ed802 Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Tue, 7 Oct 2025 17:57:37 +0300 Subject: [PATCH 2/5] Update page.tsx --- apps/web/app/s/[videoId]/page.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx index e789adb4a5..deebe39a77 100644 --- a/apps/web/app/s/[videoId]/page.tsx +++ b/apps/web/app/s/[videoId]/page.tsx @@ -362,6 +362,7 @@ async function AuthorizedContent({ orgSettings?: OrganizationSettings | null; videoSettings?: OrganizationSettings | null; organizationIconUrl?: string | null; + organizationName?: string | null; }; searchParams: { [key: string]: string | string[] | undefined }; }) { From 518f3b99113bd0cbed5711274ac0559ebd8fbdff Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Tue, 7 Oct 2025 18:00:42 +0300 Subject: [PATCH 3/5] fix --- apps/web/app/s/[videoId]/_components/ShareHeader.tsx | 4 +--- apps/web/app/s/[videoId]/page.tsx | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx index 460184b37a..94ddea7987 100644 --- a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx +++ b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx @@ -66,8 +66,6 @@ export const ShareHeader = ({ const isOwner = user && user.id.toString() === data.ownerId; - console.log(data); - const { webUrl } = usePublicEnv(); useEffect(() => { @@ -220,7 +218,7 @@ export const ShareHeader = ({ ) : ( )} diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx index deebe39a77..04e1c62124 100644 --- a/apps/web/app/s/[videoId]/page.tsx +++ b/apps/web/app/s/[videoId]/page.tsx @@ -289,6 +289,8 @@ export default async function ShareVideoPage(props: PageProps<"/s/[videoId]">) { duration: videos.duration, fps: videos.fps, hasPassword: sql`${videos.password} IS NOT NULL`.mapWith(Boolean), + organizationIconUrl: organizations.iconUrl, + organizationName: organizations.name, sharedOrganization: { organizationId: sharedVideos.organizationId, }, From ddd4a031df9de8565a76c387fb1317a9aefbcd6b Mon Sep 17 00:00:00 2001 From: ameer2468 <33054370+ameer2468@users.noreply.github.com> Date: Tue, 7 Oct 2025 18:25:42 +0300 Subject: [PATCH 4/5] minor fixes --- apps/web/app/(org)/dashboard/caps/Caps.tsx | 3 ++- apps/web/app/(org)/dashboard/caps/components/Folder.tsx | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/web/app/(org)/dashboard/caps/Caps.tsx b/apps/web/app/(org)/dashboard/caps/Caps.tsx index 10869c80a0..4d613cfa6d 100644 --- a/apps/web/app/(org)/dashboard/caps/Caps.tsx +++ b/apps/web/app/(org)/dashboard/caps/Caps.tsx @@ -232,6 +232,7 @@ export const Caps = ({ data.error === 1 ? "" : "s" }`; } + router.refresh(); return `Successfully deleted ${data.success} cap${ data.success === 1 ? "" : "s" }`; @@ -266,7 +267,7 @@ export const Caps = ({ [data, isUploading, uploadingCapId], ); - if (count === 0) return ; + if (count === 0 && folders.length === 0) return ; return (
diff --git a/apps/web/app/(org)/dashboard/caps/components/Folder.tsx b/apps/web/app/(org)/dashboard/caps/components/Folder.tsx index 51b2b846d1..53778178a8 100644 --- a/apps/web/app/(org)/dashboard/caps/components/Folder.tsx +++ b/apps/web/app/(org)/dashboard/caps/components/Folder.tsx @@ -273,9 +273,11 @@ const FolderCard = ({
Date: Tue, 7 Oct 2025 18:27:45 +0300 Subject: [PATCH 5/5] Update ShareHeader.tsx --- apps/web/app/s/[videoId]/_components/ShareHeader.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx index 94ddea7987..84279a1c89 100644 --- a/apps/web/app/s/[videoId]/_components/ShareHeader.tsx +++ b/apps/web/app/s/[videoId]/_components/ShareHeader.tsx @@ -74,11 +74,11 @@ export const ShareHeader = ({ const handleBlur = async () => { setIsEditing(false); - if (title === data.name) { - return; - } + const next = title.trim(); + if (next === "" || next === data.name) return; try { - await editTitle(data.id, title); + await editTitle(data.id, next); + setTitle(next); toast.success("Video title updated"); refresh(); } catch (error) { @@ -87,6 +87,7 @@ export const ShareHeader = ({ } else { toast.error("Failed to update title - please try again."); } + setTitle(data.name); } };