Skip to content

Commit

Permalink
Moves actions to their own folder and fixes speaker modal styling.
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyleelarson committed Aug 23, 2023
1 parent 8aac17b commit 337e679
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use server";

import Stripe from "stripe";

export const register = async (data: FormData) => {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/molecules/NewsletterModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { FormEvent, ReactNode, useRef, useState } from "react";
import { subscribe } from "../../../actions/subscribe";
import { Button } from "../../atoms/Button";
import { Modal } from "../../atoms/Modal";
import { TextField } from "../../atoms/TextField";
import * as styles from "./NewsletterModal.css";
import { subscribe } from "./subscribe";

export interface NewsletterModalProps {
trigger?: ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/RegistrationModal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ReactNode } from "react";
import { register } from "../../../actions/register";
import { Button } from "../../atoms/Button";
import { Modal } from "../../atoms/Modal";
import { TextField } from "../../atoms/TextField";
import * as styles from "./RegistrationModal.css";
import { register } from "./register";

export interface RegistrationModalProps {
trigger?: ReactNode;
Expand Down
18 changes: 7 additions & 11 deletions src/components/molecules/SpeakerModal/SpeakerModal.css.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
import { globalStyle, style } from "@vanilla-extract/css";
import { breakpoints, theme } from "@/src/styles/theme.css";

export const modal = style({
height: 500,
padding: 0,
});

export const grid = style({
export const container = style({
display: "grid",
gridTemplateAreas: `
'header image'
'content content'
'header image'
'content content'
`,
gridTemplateColumns: "4fr 1fr",
gridTemplateRows: "auto 1fr",
height: "100%",
padding: 0,
textAlign: "left",

"@media": {
[breakpoints.medium]: {
gridTemplateAreas: `
'header image'
'content image'
'header image'
'content image'
`,
gridTemplateColumns: "2fr 1fr",
height: 500,
},
},
});
Expand Down
68 changes: 35 additions & 33 deletions src/components/molecules/SpeakerModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,44 @@ export const SpeakerModal = (props: SpeakerModalProps) => {
);

return (
<Modal ariaLabel="Speaker" className={styles.modal} trigger={props.trigger}>
<div className={styles.grid}>
<header className={styles.header}>
<h2 className={styles.name}>
{props.speaker.fields.alternateName || props.speaker.fields.name}
</h2>
{props.speaker.fields.titles &&
props.speaker.fields.titles.length > 0 && (
<ul className={styles.details}>
{props.speaker?.fields.titles?.map((title, index) => {
const [role, organization] = title.split("|");
<Modal
ariaLabel="Speaker"
contentClassName={styles.container}
trigger={props.trigger}
>
<header className={styles.header}>
<h2 className={styles.name}>
{props.speaker.fields.alternateName || props.speaker.fields.name}
</h2>
{props.speaker.fields.titles &&
props.speaker.fields.titles.length > 0 && (
<ul className={styles.details}>
{props.speaker?.fields.titles?.map((title, index) => {
const [role, organization] = title.split("|");

return (
<li className={styles.detail} key={index}>
{organization && <strong>{organization.trim()}</strong>}
<span>{role.trim()}</span>
</li>
);
})}
</ul>
)}
</header>
<div className={styles.content}>
{props.speaker.fields.topic && (
<p className={styles.topic}>{props.speaker.fields.topic}</p>
return (
<li className={styles.detail} key={index}>
{organization && <strong>{organization.trim()}</strong>}
<span>{role.trim()}</span>
</li>
);
})}
</ul>
)}
<RichText field={props.speaker.fields.description} />
</div>
<Image
alt=""
className={styles.image}
height={headshot?.fields.file?.details?.image?.height}
src={headshot?.fields.file?.url as string}
width={headshot?.fields.file?.details?.image?.width}
/>
</header>
<div className={styles.content}>
{props.speaker.fields.topic && (
<p className={styles.topic}>{props.speaker.fields.topic}</p>
)}
<RichText field={props.speaker.fields.description} />
</div>
<Image
alt=""
className={styles.image}
height={headshot?.fields.file?.details?.image?.height}
src={headshot?.fields.file?.url as string}
width={headshot?.fields.file?.details?.image?.width}
/>
</Modal>
);
};

0 comments on commit 337e679

Please sign in to comment.