Skip to content

Commit 952f0f4

Browse files
rajat1saxenakazablockkaza.vishnu
authored
Next 15 (#633)
* Upgraded to Next 15; Fixes: hydration warning, checkout button disabled upon logging in * prettier fixes * Lint fixes * feat: prevent video download in course videos (#620) - Add controlsList='nodownload' attribute to all video/audio elements - Implement onContextMenu prevention to disable right-click context menu - Add CSS-based protection for user selection and drag prevention - Apply protections across lesson viewer, community posts, and video components - Ensure protection works even when JavaScript is disabled (partial) This prevents users from easily downloading course videos through: - Browser's built-in video controls download button - Right-click context menu 'Save video as' option - Drag and drop video element downloading Files modified: - apps/web/components/public/lesson-viewer/index.tsx - apps/web/components/community/index.tsx - packages/components-library/src/video-with-preview.tsx - apps/web/styles/globals.css Co-authored-by: kaza.vishnu <kaza.vishnu@rakuten.con> --------- Co-authored-by: Kaza Naga Sai Vishnu <61467615+kazablock@users.noreply.github.com> Co-authored-by: kaza.vishnu <kaza.vishnu@rakuten.con>
1 parent 122d0f9 commit 952f0f4

File tree

67 files changed

+1580
-1379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1580
-1379
lines changed

apps/docs/src/pages/en/website/blocks.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You will also see the newly added link on the header itself.
3636
3. Click on the pencil icon against the newly added link to edit it as shown above.
3737
4. Change the label (displayed as text on the header block) and the URL (where the user should be taken upon clicking the label on the header) and click `Done` to save.
3838
![Header edit link](/assets/pages/header-edit-link.png)
39-
</details>
39+
</details>
4040

4141
### [Rich Text](#rich-text)
4242

@@ -61,7 +61,7 @@ You can also use the floating controls to do the same as shown below.
6161
2. Click on the floating `link` button to reveal a popup text input.
6262
3. In the popup text input, enter the URL as shown below.
6363
![Create a hyperlink in rich text block](/assets/pages/rich-text-create-hyperlink.gif)
64-
</details>
64+
</details>
6565

6666
### [Hero](#hero)
6767

@@ -87,7 +87,7 @@ Following is how it looks on a page.
8787
4. In the button action, enter the URL the user should be taken to upon clicking.
8888
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
8989
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
90-
</details>
90+
</details>
9191

9292
### [Grid](#grid)
9393

@@ -132,7 +132,7 @@ A grid block comes in handy when you want to show some sort of list, for example
132132
4. In the button action, enter the URL the user should be taken to upon clicking.
133133
a. If the URL is from your own school, use its relative form, i.e., `/courses`.
134134
b. If the URL is from some external website, use the absolute (complete) URL, i.e., `https://website.com/courses`.
135-
</details>
135+
</details>
136136

137137
### [Featured](#featured)
138138

@@ -268,7 +268,7 @@ In the `Design` panel, you can customize:
268268
- Maximum width
269269
- Vertical padding
270270
- Social media links (Facebook, Twitter, Instagram, LinkedIn, YouTube, Discord, GitHub)
271-
</details>
271+
</details>
272272

273273
## [Shared blocks](#shared-blocks)
274274

apps/docs/src/pages/en/website/themes.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -192,30 +192,30 @@ The typography editor lets you customize text styles across your website. These
192192
- Header 3: Smaller titles for subsections
193193
- Header 4: Small titles for minor sections
194194
- Preheader: Introductory text that appears above headers
195-
</details>
195+
</details>
196196

197197
<details>
198198
<summary>Subheaders</summary>
199199

200200
- Subheader 1: Primary subheaders for section introductions
201201
- Subheader 2: Secondary subheaders for supporting text
202-
</details>
202+
</details>
203203

204204
<details>
205205
<summary>Body Text</summary>
206206

207207
- Text 1: Main body text for content
208208
- Text 2: Secondary body text for supporting content
209209
- Caption: Small text for image captions and footnotes
210-
</details>
210+
</details>
211211

212212
<details>
213213
<summary>Interactive Elements</summary>
214214

215215
- Link: Text for clickable links
216216
- Button: Text for buttons and calls-to-action
217217
- Input: Text for form fields and search boxes
218-
</details>
218+
</details>
219219

220220
For each text style, you can customize:
221221

@@ -243,7 +243,7 @@ CourseLit provides a carefully curated selection of professional fonts, organize
243243
- **Mulish**: A geometric sans-serif with a modern feel
244244
- **Nunito**: A well-balanced font with rounded terminals
245245
- **Work Sans**: A clean, modern font with a geometric feel
246-
</details>
246+
</details>
247247

248248
<details>
249249
<summary>Serif Fonts</summary>
@@ -253,7 +253,7 @@ CourseLit provides a carefully curated selection of professional fonts, organize
253253
- **Playfair Display**: An elegant serif font for headings
254254
- **Roboto Slab**: A serif variant of Roboto
255255
- **Source Serif 4**: A serif font designed for digital reading
256-
</details>
256+
</details>
257257

258258
<details>
259259
<summary>Display Fonts</summary>
@@ -264,15 +264,15 @@ CourseLit provides a carefully curated selection of professional fonts, organize
264264
- **Rubik**: A sans-serif with a geometric feel
265265
- **Oswald**: A reworking of the classic style
266266
- **Bebas Neue**: A display font with a strong personality
267-
</details>
267+
</details>
268268

269269
<details>
270270
<summary>Modern Fonts</summary>
271271

272272
- **Lato**: A sans-serif font with a warm feel
273273
- **PT Sans**: A font designed for public use
274274
- **Quicksand**: A display sans-serif with rounded terminals
275-
</details>
275+
</details>
276276

277277
Each font is optimized for web use and includes multiple weights for flexibility in design. All fonts support Latin characters and are carefully selected for their readability and professional appearance.
278278

@@ -290,7 +290,7 @@ The interactives editor allows you to customize the appearance of interactive el
290290
- Shadow effects: From None to 2X Large
291291
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
292292
- Disabled state: How the button looks when it can't be clicked
293-
</details>
293+
</details>
294294

295295
<details>
296296
<summary>Link</summary>
@@ -300,7 +300,7 @@ The interactives editor allows you to customize the appearance of interactive el
300300
- Text shadow: Add depth to your links
301301
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
302302
- Disabled state: How the link looks when it can't be clicked
303-
</details>
303+
</details>
304304

305305
<details>
306306
<summary>Card</summary>
@@ -309,7 +309,7 @@ The interactives editor allows you to customize the appearance of interactive el
309309
- Border style: Choose from various border styles
310310
- Shadow effects: Add depth to your cards
311311
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
312-
</details>
312+
</details>
313313

314314
<details>
315315
<summary>Input</summary>
@@ -320,7 +320,7 @@ The interactives editor allows you to customize the appearance of interactive el
320320
- Shadow effects: Add depth to your input fields
321321
- Custom styles: Add your own custom styles using [supported Tailwind classes](#supported-tailwind-classes)
322322
- Disabled state: How the input looks when it can't be used
323-
</details>
323+
</details>
324324

325325
### 4. Structure
326326

@@ -332,14 +332,14 @@ The structure editor lets you customize the layout of your pages, like section p
332332
<summary>Page</summary>
333333

334334
- Maximum width options: - 2XL (42rem): Compact layout - 3XL (48rem): Standard layout - 4XL (56rem): Wide layout - 5XL (64rem): Extra wide layout - 6XL (72rem): Full width layout
335-
</details>
335+
</details>
336336

337337
<details>
338338
<summary>Section</summary>
339339

340340
- Horizontal padding: Space on the left and right sides (None to 9X Large)
341341
- Vertical padding: Space on the top and bottom (None to 9X Large)
342-
</details>
342+
</details>
343343

344344
## Publishing Changes
345345

@@ -387,7 +387,7 @@ When adding custom styles to interactive elements, you can use the following Tai
387387
- `text-6xl`: 6X large text
388388
- `text-7xl`: 7X large text
389389
- `text-8xl`: 8X large text
390-
</details>
390+
</details>
391391

392392
<details>
393393
<summary>Padding</summary>
@@ -399,7 +399,7 @@ When adding custom styles to interactive elements, you can use the following Tai
399399
#### Horizontal Padding
400400

401401
- `px-4` to `px-20`: Horizontal padding from 1rem to 5rem
402-
</details>
402+
</details>
403403

404404
<details>
405405
<summary>Colors</summary>
@@ -454,7 +454,7 @@ Variants available: `hover`, `disabled`, `dark`
454454
- `ease-out`: Ease out
455455
- `ease-in-out`: Ease in and out
456456
- `ease-linear`: Linear
457-
</details>
457+
</details>
458458

459459
<details>
460460
<summary>Transforms</summary>
@@ -481,7 +481,7 @@ Variants available: `hover`, `disabled`, `dark`
481481
- `scale-110`: 110% scale
482482
- `scale-125`: 125% scale
483483
- `scale-150`: 150% scale
484-
</details>
484+
</details>
485485

486486
<details>
487487
<summary>Shadows</summary>

apps/web/app/(with-contexts)/(with-layout)/blog/[slug]/[id]/layout.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ import type { Metadata, ResolvingMetadata } from "next";
22
import { ReactNode } from "react";
33
import { FetchBuilder } from "@courselit/utils";
44
import { headers } from "next/headers";
5-
import { getAddressFromHeaders, getSiteInfo } from "@ui-lib/utils";
5+
import { getSiteInfo } from "@ui-lib/utils";
66
import { Course } from "@courselit/common-models";
7+
import { getAddressFromHeaders } from "@/app/actions";
78

89
export async function generateMetadata(
9-
{ params }: { params: { id: string } },
10+
props: { params: Promise<{ id: string }> },
1011
parent: ResolvingMetadata,
1112
): Promise<Metadata> {
12-
const address = getAddressFromHeaders(headers);
13+
const params = await props.params;
14+
const address = await getAddressFromHeaders(headers);
1315
const [product, siteInfo] = await Promise.all([
1416
getProduct(params.id, address),
1517
getSiteInfo(address),

apps/web/app/(with-contexts)/(with-layout)/blog/[slug]/[id]/page.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Course } from "@courselit/common-models";
22
import { Caption, Header1, Section, Text1 } from "@courselit/page-primitives";
33
import { formattedLocaleDate, getFullSiteSetup } from "@ui-lib/utils";
4-
import { getAddressFromHeaders } from "@ui-lib/utils";
4+
import { getAddressFromHeaders } from "@/app/actions";
55
import { headers } from "next/headers";
66
import { ProductWithAdminProps } from "@/hooks/use-product";
77
import { FetchBuilder } from "@courselit/utils";
@@ -19,13 +19,12 @@ import {
1919
BreadcrumbSeparator,
2020
} from "@components/ui/breadcrumb";
2121

22-
export default async function ProductPage({
23-
params,
24-
}: {
25-
params: { slug: string; id: string };
22+
export default async function ProductPage(props: {
23+
params: Promise<{ slug: string; id: string }>;
2624
course: Course;
2725
}) {
28-
const address = getAddressFromHeaders(headers);
26+
const params = await props.params;
27+
const address = await getAddressFromHeaders(headers);
2928
const [product, siteInfo] = await Promise.all([
3029
getProduct(address, params.id),
3130
getFullSiteSetup(address),

apps/web/app/(with-contexts)/(with-layout)/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ import { auth } from "@/auth";
22
import { SessionProvider } from "next-auth/react";
33
import HomepageLayout from "./home-page-layout";
44
import { headers } from "next/headers";
5-
import { getAddressFromHeaders, getFullSiteSetup } from "@ui-lib/utils";
5+
import { getFullSiteSetup } from "@ui-lib/utils";
6+
import { getAddressFromHeaders } from "@/app/actions";
67

78
export default async function Layout({
89
children,
910
}: {
1011
children: React.ReactNode;
1112
}) {
12-
const address = getAddressFromHeaders(headers);
13+
const address = await getAddressFromHeaders(headers);
1314
const [siteInfo, session] = await Promise.all([
1415
getFullSiteSetup(address),
1516
auth(),

apps/web/app/(with-contexts)/(with-layout)/p/[id]/page.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import { getFullSiteSetup, getPage } from "@ui-lib/utils";
2-
import { getAddressFromHeaders } from "@/ui-lib/utils";
2+
import { getAddressFromHeaders } from "@/app/actions";
33
import ClientSidePage from "./client-side-page";
44
import { headers } from "next/headers";
55
import type { Metadata, ResolvingMetadata } from "next";
66
import { Media } from "@courselit/common-models";
77
import { notFound } from "next/navigation";
88

99
type Props = {
10-
params: {
10+
params: Promise<{
1111
id: string;
12-
};
12+
}>;
1313
};
1414

1515
export async function generateMetadata(
16-
{ params }: Props,
16+
props: Props,
1717
parent: ResolvingMetadata,
1818
): Promise<Metadata> {
19-
const address = getAddressFromHeaders(headers);
19+
const params = await props.params;
20+
const address = await getAddressFromHeaders(headers);
2021
const [siteInfo, page] = await Promise.all([
2122
getFullSiteSetup(address),
2223
getPage(address, params.id),
@@ -73,8 +74,9 @@ export async function generateMetadata(
7374
};
7475
}
7576

76-
export default async function Page({ params }: Props) {
77-
const address = getAddressFromHeaders(headers);
77+
export default async function Page(props: Props) {
78+
const params = await props.params;
79+
const address = await getAddressFromHeaders(headers);
7880
const [siteInfo, page] = await Promise.all([
7981
getFullSiteSetup(address),
8082
getPage(address, params.id),

apps/web/app/(with-contexts)/(with-layout)/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getFullSiteSetup } from "@ui-lib/utils";
2-
import { getAddressFromHeaders } from "@/ui-lib/utils";
2+
import { getAddressFromHeaders } from "@/app/actions";
33
import ClientSidePage from "./p/[id]/client-side-page";
44
import { headers } from "next/headers";
55
import type { Metadata, ResolvingMetadata } from "next";
@@ -14,7 +14,7 @@ export async function generateMetadata(
1414
{ params }: Props,
1515
parent: ResolvingMetadata,
1616
): Promise<Metadata> {
17-
const address = getAddressFromHeaders(headers);
17+
const address = await getAddressFromHeaders(headers);
1818
const siteInfo = await getFullSiteSetup(address, "homepage");
1919
if (!siteInfo) {
2020
return {
@@ -62,7 +62,7 @@ export async function generateMetadata(
6262
}
6363

6464
export default async function Page() {
65-
const address = getAddressFromHeaders(headers);
65+
const address = await getAddressFromHeaders(headers);
6666
const siteInfo = await getFullSiteSetup(address, "homepage");
6767
if (!siteInfo) {
6868
return null;

apps/web/app/(with-contexts)/course/[slug]/[id]/[lesson]/page.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
import { LessonViewer } from "@components/public/lesson-viewer";
44
import { redirect } from "next/navigation";
5-
import { useContext } from "react";
5+
import { useContext, use } from "react";
66
import { ProfileContext, AddressContext } from "@components/contexts";
77
import { Profile } from "@courselit/common-models";
88

9-
export default function LessonPage({
10-
params,
11-
}: {
12-
params: {
9+
export default function LessonPage(props: {
10+
params: Promise<{
1311
slug: string;
1412
id: string;
1513
lesson: string;
16-
};
14+
}>;
1715
}) {
16+
const params = use(props.params);
1817
const { slug, id, lesson } = params;
1918
const { profile, setProfile } = useContext(ProfileContext);
2019
const address = useContext(AddressContext);

0 commit comments

Comments
 (0)