Skip to content

Commit 9496ab0

Browse files
committed
hide watermark for pro user videos creators
1 parent 790c89f commit 9496ab0

File tree

6 files changed

+58
-6
lines changed

6 files changed

+58
-6
lines changed

apps/desktop/src/styles/theme.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,24 @@
154154
.gray-button-shadow {
155155
box-shadow: 0 1.5px 0 0 rgba(255, 255, 255, 0.4) inset;
156156
}
157+
158+
.dark .gray-button-border {
159+
@apply border-gray-2
160+
}
161+
162+
.gray-button-border {
163+
@apply border-gray-8
164+
}
165+
166+
.dark .dark-button-border {
167+
@apply border-gray-2
168+
}
169+
170+
.dark-button-border {
171+
@apply border-gray-12
172+
}
173+
174+
157175
[data-transparent-window] {
158176
background: transparent !important;
159177
}

apps/web/app/globals.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,22 @@ html {
8484
box-shadow: 0 1.5px 0 0 rgba(255, 255, 255, 0.1) inset;
8585
}
8686

87+
.dark .gray-button-border {
88+
@apply border-gray-2
89+
}
90+
91+
.gray-button-border {
92+
@apply border-gray-8
93+
}
94+
95+
.dark .dark-button-border {
96+
@apply border-gray-2
97+
}
98+
99+
.dark-button-border {
100+
@apply border-gray-12
101+
}
102+
87103
.gray-button-shadow {
88104
box-shadow: 0 1.5px 0 0 rgba(255, 255, 255, 0.4) inset;
89105
}

apps/web/app/s/[videoId]/_components/ShareVideo.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ type CommentWithAuthor = typeof commentsSchema.$inferSelect & {
3535
export const ShareVideo = forwardRef<
3636
HTMLVideoElement,
3737
{
38-
data: typeof videos.$inferSelect;
38+
data: typeof videos.$inferSelect & {
39+
owner: {
40+
stripeSubscriptionStatus: string | null;
41+
thirdPartyStripeSubscriptionId: string | null;
42+
};
43+
};
3944
user: typeof userSelectProps | null;
4045
comments: MaybePromise<CommentWithAuthor[]>;
4146
chapters?: { title: string; start: number }[];
@@ -144,6 +149,8 @@ export const ShareVideo = forwardRef<
144149
videoSrc = `${publicEnv.s3BucketUrl}/${data.ownerId}/${data.id}/combined-source/stream.m3u8`;
145150
}
146151

152+
const isVideoOwnerPro = userIsPro(data.owner);
153+
147154
return (
148155
<>
149156
<div className="relative h-full">
@@ -167,7 +174,7 @@ export const ShareVideo = forwardRef<
167174
)}
168175
</div>
169176

170-
{!userIsPro(user) && (
177+
{!isVideoOwnerPro && (
171178
<div className="absolute top-4 left-4 z-30">
172179
<div
173180
className="block cursor-pointer"

apps/web/app/s/[videoId]/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,15 @@ export default async function ShareVideoPage(props: Props) {
288288
sharedOrganization: {
289289
organizationId: sharedVideos.organizationId,
290290
},
291+
owner: {
292+
stripeSubscriptionStatus: users.stripeSubscriptionStatus,
293+
thirdPartyStripeSubscriptionId:
294+
users.thirdPartyStripeSubscriptionId,
295+
},
291296
})
292297
.from(videos)
293298
.leftJoin(sharedVideos, eq(videos.id, sharedVideos.videoId))
299+
.leftJoin(users, eq(videos.ownerId, users.id))
294300
.where(eq(videos.id, videoId)),
295301
).pipe(Policy.withPublicPolicy(videosPolicy.canView(videoId)));
296302

@@ -437,6 +443,10 @@ async function AuthorizedContent({
437443
id: videos.id,
438444
name: videos.name,
439445
ownerId: videos.ownerId,
446+
owner: {
447+
stripeSubscriptionStatus: users.stripeSubscriptionStatus,
448+
thirdPartyStripeSubscriptionId: users.thirdPartyStripeSubscriptionId,
449+
},
440450
createdAt: videos.createdAt,
441451
updatedAt: videos.updatedAt,
442452
awsRegion: videos.awsRegion,
@@ -459,6 +469,7 @@ async function AuthorizedContent({
459469
})
460470
.from(videos)
461471
.leftJoin(sharedVideos, eq(videos.id, sharedVideos.videoId))
472+
.leftJoin(users, eq(videos.ownerId, users.id))
462473
.where(eq(videos.id, videoId))
463474
.execute();
464475

packages/ui-solid/src/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ const styles = cva(
2020
white:
2121
"bg-gray-1 border border-gray-6 text-gray-12 hover:bg-gray-3 disabled:bg-gray-8",
2222
ghost: "hover:bg-white/20 hover:text-white",
23-
gray: "bg-gray-5 data-[selected=true]:!bg-gray-8 dark:data-[selected=true]:!bg-gray-9 hover:bg-gray-7 border border-gray-6 gray-button-shadow text-gray-12 disabled:bg-gray-8 disabled:text-gray-9",
24-
dark: "bg-gray-12 dark-button-shadow hover:bg-gray-11 border border-gray-12 text-gray-1 disabled:cursor-not-allowed disabled:text-gray-10 disabled:bg-gray-7 disabled:border-gray-8",
23+
gray: "bg-gray-5 data-[selected=true]:!bg-gray-8 dark:data-[selected=true]:!bg-gray-9 hover:bg-gray-7 border gray-button-border gray-button-shadow text-gray-12 disabled:bg-gray-8 disabled:text-gray-9",
24+
dark: "bg-gray-12 dark-button-border dark-button-shadow hover:bg-gray-11 border text-gray-1 disabled:cursor-not-allowed disabled:text-gray-10 disabled:bg-gray-7 disabled:border-gray-8",
2525
darkgradient:
2626
"bg-gradient-to-t button-gradient-border from-[#0f0f0f] to-[#404040] shadow-[0_0_0_1px] hover:brightness-110 shadow-[#383838] text-gray-50 hover:bg-[#383838] disabled:bg-[#383838] border-transparent",
2727
radialblue:

packages/ui/src/components/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const buttonVariants = cva(
2323
white:
2424
"bg-gray-1 border border-gray-6 text-gray-12 hover:bg-gray-3 disabled:bg-gray-8",
2525
ghost: "hover:bg-white/20 hover:text-white",
26-
gray: "bg-gray-5 hover:bg-gray-7 border border-gray-6 gray-button-shadow text-gray-12 disabled:border-gray-7 disabled:bg-gray-8 disabled:text-gray-11",
27-
dark: "bg-gray-12 dark-button-shadow hover:bg-gray-11 border border-gray-12 text-gray-1 disabled:cursor-not-allowed disabled:text-gray-10 disabled:bg-gray-7 disabled:border-gray-8",
26+
gray: "bg-gray-5 hover:bg-gray-7 border gray-button-border gray-button-shadow text-gray-12 disabled:border-gray-7 disabled:bg-gray-8 disabled:text-gray-11",
27+
dark: "bg-gray-12 dark-button-shadow hover:bg-gray-11 border dark-button-border text-gray-1 disabled:cursor-not-allowed disabled:text-gray-10 disabled:bg-gray-7 disabled:border-gray-8",
2828
darkgradient:
2929
"bg-gradient-to-t button-gradient-border from-[#0f0f0f] to-[#404040] shadow-[0_0_0_1px] hover:brightness-110 shadow-[#383838] text-gray-50 hover:bg-[#383838] disabled:bg-[#383838] border-transparent",
3030
radialblue:

0 commit comments

Comments
 (0)