Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion frontends/main/src/app/c/[channelType]/[name]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export async function generateMetadata({
searchParams,
title: `${channelDetails.title}`,
description: channelDetails.public_description,
image: channelDetails.configuration.logo,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the other changes, but...

  • we noticed the metadataBase issue because channel og:image were not working
  • og:image cannot be an SVG, so without this change, they still won't work.

})
}

Expand Down
11 changes: 9 additions & 2 deletions frontends/main/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
"use client"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layout.tsx needs to be a server component in order to define metadata


import React from "react"
import Header from "@/page-components/Header/Header"
import Footer from "@/page-components/Footer/Footer"
Expand All @@ -11,6 +9,15 @@ import ErrorBoundary from "@/components/ErrorBoundary/ErrorBoundary"

import "./GlobalStyles"

const { NEXT_PUBLIC_ORIGIN } = process.env

/**
* As part of the root layout, this metadata object is site-wide defaults
*/
export const metadata = {
metadataBase: NEXT_PUBLIC_ORIGIN ? new URL(NEXT_PUBLIC_ORIGIN) : null,
}

export default function RootLayout({
children,
}: Readonly<{
Expand Down
3 changes: 0 additions & 3 deletions frontends/main/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ import type { Metadata } from "next"
import HomePage from "@/app-pages/HomePage/HomePage"
import { getMetadataAsync } from "@/common/metadata"

const { NEXT_PUBLIC_ORIGIN } = process.env

export async function generateMetadata({
searchParams,
}: {
searchParams: { [key: string]: string | string[] | undefined }
}): Promise<Metadata> {
return await getMetadataAsync({
metadataBase: NEXT_PUBLIC_ORIGIN ? new URL(NEXT_PUBLIC_ORIGIN) : null,
title: "Learn with MIT",
searchParams,
})
Expand Down
1 change: 1 addition & 0 deletions frontends/ol-components/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"use client"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all client components for now because they use runtime CSS-in-JS (Emotion) which depends on react useContext.

Marking them as use-client allows importing them into server components.

/// <reference types="./types/theme.d.ts" />
/// <reference types="./types/typography.d.ts" />

Expand Down
Loading