Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
Add media query for stacking
Browse files Browse the repository at this point in the history
  • Loading branch information
tanettrimas committed Jul 25, 2023
1 parent f9db268 commit 4ab5d7b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 19 deletions.
33 changes: 33 additions & 0 deletions app/program/[id]/page.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.programHeader {
display: block;
font-weight: bold;
margin-bottom: 1rem;
}

.abstract {
white-space: pre-line;
}

.topBottomMargin {
margin: 2rem 0 !important;
}

.speakerList {
list-style: none !important;
}

.imageContainer {
display: inline-flex;
align-items: center;
gap: 0.5rem;
}

@media screen and (min-width: 600px) {
.programHeader {
display: flex;
justify-content: space-between;
gap: 0.5rem;
font-weight: 600;
font-size: x-large;
}
}
36 changes: 17 additions & 19 deletions app/program/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { formatter, prettyFormat, prettyLanguage } from '@/app/program/utils'
import Image from 'next/image'
import { Session } from '@/app/program/program'
import { Metadata, ResolvingMetadata } from 'next'
import styles from './page.module.css'

function getDayAndTime({ endTime, startTime }: Session) {
if (!startTime || !endTime) {
Expand Down Expand Up @@ -72,40 +73,37 @@ export default async function Page({
return (
<div className="content is-normal">
<h1 className="title">{session.title}</h1>
<div
style={{
display: 'inline-flex',
fontWeight: 600,
gap: '2rem',
fontSize: 'x-large',
}}
>
<p>{prettyFormat(session.format)}</p>-<p>{prettyLanguage(session.language)}</p>-
<div className={styles.programHeader}>
<p>{prettyFormat(session.format)}</p>
<p>{prettyLanguage(session.language)}</p>
{!!dayAndTime && !!session.room ? <p>{dayAndTime}</p> : <p>Day & time coming soon</p>}
</div>
<p>
<b>Length:</b> {session.length} minutes
</p>
<p>
<b>Room:</b> {session.room ? session.room : 'Coming soon'}
</p>
<div>
<p>
<b>Length:</b> {session.length} minutes
</p>
<p>
<b>Room:</b> {session.room ? session.room : 'Coming soon'}
</p>
</div>

<h3>Abstract</h3>
<p style={{ whiteSpace: 'pre-line' }}>{session.abstract}</p>
<p className={styles.abstract}>{session.abstract}</p>

<h3>Day & time</h3>
<p>{dayAndTime ? getDayAndTime(session) : 'Coming soon'}</p>

<h3>Intended audience</h3>
<p>{session.intendedAudience}</p>

<ul style={{ listStyle: 'none', margin: '2rem 0' }}>
<ul className={`${styles.speakerList} ${styles.topBottomMargin}`}>
{session.speakers.map((speaker) => (
<li key={speaker.name} style={{ margin: '2rem 0' }}>
<li key={speaker.name} className={styles.topBottomMargin}>
<h3>{speaker.name}</h3>
<p>{speaker.bio}</p>
{!!speaker.twitter && (
<a href={`https://twitter.com/${speaker.twitter}`}>
<div style={{ display: 'inline-flex', alignItems: 'center', gap: '0.5rem' }}>
<div className={styles.imageContainer}>
<Image
src={'/icons/twitter-icon.svg'}
alt={'Twitter logo'}
Expand Down
1 change: 1 addition & 0 deletions app/program/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const formatter = new Intl.DateTimeFormat(['en'], {
weekday: 'long',
hour: 'numeric',
minute: 'numeric',
month: "long"
})
export const prettyFormat = (format: Filter['format']) => {
switch (format) {
Expand Down

1 comment on commit 4ab5d7b

@vercel
Copy link

@vercel vercel bot commented on 4ab5d7b Jul 25, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.