diff --git a/components/EventCard.module.css b/components/EventCard.module.css index 714c609a..1fa1408e 100644 --- a/components/EventCard.module.css +++ b/components/EventCard.module.css @@ -2,7 +2,7 @@ display: flex; flex-direction: row; box-sizing: border-box; - padding: calc(24rem / 16); + padding: calc(20rem / 16) 0; } .card aside { @@ -12,10 +12,10 @@ .card aside img { width: 100%; - margin-bottom: 1rem; } .registerButton { + margin-top: 1rem; font-weight: bold; } @@ -44,3 +44,69 @@ font-size: 1rem; margin-bottom: calc(14rem / 16); } + +.mobileLearnMore { + display: none; +} + +@media only screen and (max-width: calc(768rem / 16)) { + .card { + flex-direction: column; + } + + .card aside { + margin: 0; + } + + .card aside img { + box-sizing: border-box; + border: calc(1rem / 16) solid var(--text); + } + + .content { + margin-top: 1rem; + } + + .content { + text-align: center; + } + + .content > h1, + .content > h2 { + font-size: 1rem; + line-height: calc(30 / 16); + } + + .content > h2 { + margin-bottom: 0; + } + + .mobileShowDescriptionContent { + text-align: unset; + } + + .mobileShowDescriptionContent > h1 { + font-size: calc(24rem / 16); + margin-bottom: calc(8rem / 16); + } + + .registerButton { + display: block; + } + + .mobileLearnMore { + display: unset; + } + + .mobileShowDescriptionContent .mobileLearnMore { + display: none; + } + + .children { + display: none; + } + + .mobileShowDescriptionContent .children { + display: unset; + } +} diff --git a/components/EventCard.tsx b/components/EventCard.tsx index 193b8ff3..e9e5eaec 100644 --- a/components/EventCard.tsx +++ b/components/EventCard.tsx @@ -3,10 +3,11 @@ import React, { ReactNode } from "react"; import { Button } from "./Button"; import { EventSetting } from "./EventSetting"; import { Image } from "./Image"; +import { Link } from "./Link"; import styles from "./EventCard.module.css"; -interface EventCardProps { +interface BaseProps { name: string; short: string; date: Date; @@ -17,7 +18,12 @@ interface EventCardProps { children: ReactNode; } +type EventCardProps = + | (BaseProps & { showDescription?: false; link: string }) + | (BaseProps & { showDescription: true; link?: string }); + export function EventCard({ + link, name, date, online, @@ -25,6 +31,7 @@ export function EventCard({ poster, registerLink, children, + showDescription = false, }: EventCardProps) { return (
@@ -43,12 +50,22 @@ export function EventCard({ )} )} -
+

{name}

-
{children}
+ {!showDescription && link && ( + + Learn more + + )} +
{children}
{!poster && registerLink && (