-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup talks page #60
Merged
Merged
setup talks page #60
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7c902ad
update data fetching
rccsousa ba9bc08
add 'react-youtube' dependency
rccsousa 8d0d072
add 'get-video-id' dependency
rccsousa 19d201c
add content blocks
rccsousa 258915f
add styling
rccsousa deb2bf4
fix styling
rccsousa e6e6ac2
regenerate types and importmap
rccsousa 1e1f6d0
re-enable talks and roundtables on hub home page
rccsousa bc94f08
Merge branch 'main' of https://github.com/subvisual/content-sub into …
rccsousa a25bb3b
fix merge conflicts
rccsousa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,99 @@ | ||
// import { notFound } from 'next/navigation' | ||
// | ||
// import { fetchDoc } from '../../../_api/fetchDoc' | ||
|
||
import { Metadata } from "next"; | ||
import { fetchContentBySlug } from "@/app/_utilities/contentFetchers"; | ||
import getVideoId from "get-video-id"; | ||
import BackButton from "@/app/_components/BackButton"; | ||
import ArchiveButton from "@/app/_components/ArchiveButton"; | ||
import { formatDateTime } from "@/app/_utilities/formatDateTime"; | ||
import Share from "@/app/_components/Share"; | ||
import Categories from "@/app/_components/Categories"; | ||
import styles from "./styles.module.css"; | ||
import { Subscribe } from "@/app/_blocks/Subscribe"; | ||
import Contributors from "@/app/_blocks/EpisodeContent/Contributors"; | ||
import { TalksAndRoundtable } from "@/payload-types"; | ||
import { Metadata } from "next"; | ||
import { generateMeta } from "@/utilities/generateMeta"; | ||
|
||
export const dynamic = 'force-dynamic' | ||
export const dynamic = "force-dynamic"; | ||
|
||
export default async function TalksAndRoundTablesPage({ params: paramsPromise }) { | ||
const { slug } = await paramsPromise; | ||
|
||
// @ts-expect-error | ||
const talk: TalksAndRoundtable = await fetchContentBySlug({ | ||
slug: slug, | ||
type: "talks-and-roundtables", | ||
}); | ||
|
||
export default async function TalksAndRoundTablesPage() { | ||
/* let content = null | ||
const { title, authors, summary, url, publishedAt, categories } = talk; | ||
|
||
try { | ||
content = await fetchDoc({ | ||
collection: 'talks-and-roundtables', | ||
slug: slug, | ||
}) | ||
} catch (err) {} | ||
// move this to the collection / store in db? | ||
// @ts-ignore | ||
const videoID = getVideoId(talk.url); | ||
|
||
if (!content) { | ||
notFound() | ||
} | ||
*/ | ||
return ( | ||
<div> | ||
{/*Hello, world! | ||
<pre>{JSON.stringify(content, null, 2)}</pre>*/} | ||
{/* Head Block */} | ||
<div className={styles.headContainer}> | ||
<BackButton color={"var(--soft-white-100)"} /> | ||
<ArchiveButton collection={"talks-and-roundtables"} color={"var(--soft-white-100)"} /> | ||
{/* @ts-ignore */} | ||
<h5>{title}</h5> | ||
<p> | ||
{/* @ts-ignore */} | ||
{formatDateTime(publishedAt)} | ||
<span>Duration in mins</span> | ||
</p> | ||
|
||
</div> | ||
<div className={styles.contentContainer}> | ||
|
||
{/* Contributors column*/} | ||
<div> | ||
<Contributors className={styles.contributors} authors={authors} /> | ||
{/* @ts-ignore */} | ||
|
||
</div> | ||
|
||
{/* Content column */} | ||
<div className={styles.videoPlayer}> | ||
{videoID.service === "youtube" && ( | ||
<iframe | ||
width="560" | ||
height="315" | ||
src={`https://www.youtube.com/embed/${videoID.id}`} | ||
title="YouTube video player" | ||
frameBorder="0" | ||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" | ||
referrerPolicy="strict-origin-when-cross-origin" | ||
allowFullScreen | ||
></iframe> | ||
)} | ||
<h5>About</h5> | ||
{/* @ts-ignore */} | ||
<p>{summary}</p> | ||
</div> | ||
|
||
{/* Share & categories column */} | ||
<div className={styles.sharingAndCategories}> | ||
<Share /> | ||
{/* @ts-ignore */} | ||
{categories.length > 0 && ( | ||
// @ts-ignore | ||
<Categories categories={categories} /> | ||
)} | ||
</div> | ||
</div> | ||
<Subscribe /> | ||
|
||
</div> | ||
) | ||
); | ||
} | ||
|
||
export async function generateMetadata({ params: paramsPromise}): Promise<Metadata> { | ||
const { slug } = await paramsPromise | ||
export async function generateMetadata({ params: paramsPromise }): Promise<Metadata> { | ||
const { slug } = await paramsPromise; | ||
const talk = await fetchContentBySlug({ | ||
slug: slug, | ||
type: "talks-and-roundtables", | ||
}) | ||
}); | ||
// @ts-ignore | ||
return generateMeta({doc: talk}) | ||
return generateMeta({ doc: talk }); | ||
} |
127 changes: 127 additions & 0 deletions
127
src/app/(pages)/talks-and-roundtables/[slug]/styles.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
|
||
.headContainer { | ||
display: flex; | ||
flex-direction: column; | ||
background-color: var(--sub-purple-400); | ||
color: var(--soft-white-100); | ||
border-bottom-right-radius: 16px; | ||
border-bottom-left-radius: 16px; | ||
padding: 40px 80px; | ||
gap: 20px; | ||
} | ||
|
||
.headContainer p { | ||
display: flex; | ||
gap: 40px; | ||
} | ||
|
||
.backButton { | ||
display: block; | ||
font-family: Colfax, sans-serif; | ||
padding-top: 40px; | ||
padding-left: 15px; | ||
padding-bottom: 40px; | ||
} | ||
|
||
|
||
.contentContainer { | ||
display: grid; | ||
grid-template-rows: 2fr; | ||
font-family: var(--colfax); | ||
padding-bottom: 40px; | ||
} | ||
|
||
.contributors { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
padding: 16px; | ||
} | ||
|
||
.sharingAndCategories { | ||
display: flex; | ||
flex-direction: column; | ||
grid-row-start: 2; | ||
padding-left: 20px; | ||
gap: 30px; | ||
} | ||
|
||
.videoPlayer { | ||
padding: 20px; | ||
} | ||
|
||
.videoPlayer iframe { | ||
width: 100%; | ||
border-radius: 25px; | ||
margin-bottom: 16px; | ||
} | ||
|
||
.videoPlayer p { | ||
margin-top: 16px; | ||
text-align: justify; | ||
} | ||
|
||
.contributors { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
} | ||
|
||
@media (min-width: 1080px) { | ||
|
||
.headContainer { | ||
width: calc(100% - 40px); | ||
margin: 0 auto; | ||
} | ||
|
||
.backButton { | ||
padding-left: 95px; | ||
color: var(--soft-white-100); | ||
} | ||
|
||
.contentContainer { | ||
width: calc(100% - 40px); | ||
margin: 20px auto; | ||
display: grid; | ||
grid-template-columns: 0.3fr 0.6fr 0.3fr; | ||
} | ||
|
||
.videoPlayer { | ||
margin: auto; | ||
width: calc(100% - 40px); | ||
border-radius: 25px; | ||
} | ||
|
||
.videoPlayer iframe { | ||
width: 100%; | ||
aspect-ratio: 16 / 9; | ||
border-radius: 25px; | ||
margin-bottom: 40px; | ||
} | ||
|
||
.videoPlayer p { | ||
text-align: justify; | ||
} | ||
|
||
.contributors { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 20px; | ||
padding: 40px 40px 40px 80px; | ||
} | ||
|
||
.sharingAndCategories { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: left; | ||
padding-left: 40px; | ||
padding-top: 40px; | ||
gap: 40px; | ||
grid-column: 3 / 3; | ||
grid-row: 1 / 1; | ||
} | ||
|
||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
.container { | ||
padding: 20px; | ||
margin: 20px auto; | ||
color: var(--dark-rock-800); | ||
} | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the other service options? One option would be for people to paste the embed link in the CMS, and we just render