parent
2d27055bf8
commit
c553e9bdbc
@ -1,57 +0,0 @@ |
||||
.card { |
||||
padding: calc(30rem / 16) calc(40rem / 16); |
||||
max-width: calc(524rem / 16); |
||||
background-color: var(--primary-background); |
||||
border-radius: calc(20rem / 16); |
||||
display: -webkit-box; |
||||
-webkit-line-clamp: 3; |
||||
-webkit-box-orient: vertical; |
||||
overflow: hidden; |
||||
margin-bottom: 1rem; |
||||
} |
||||
|
||||
.fit.card { |
||||
max-width: unset; |
||||
padding: unset; |
||||
border-radius: unset; |
||||
} |
||||
|
||||
.date { |
||||
font-size: calc(18rem / 16); |
||||
margin: 0; |
||||
} |
||||
|
||||
.author { |
||||
color: var(--secondary-heading); |
||||
font-style: normal; |
||||
} |
||||
|
||||
.content { |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.content > *:first-child { |
||||
margin-top: 0; |
||||
} |
||||
|
||||
@media only screen and (max-width: calc(768rem / 16)) { |
||||
.card { |
||||
padding: 0; |
||||
max-width: unset; |
||||
background-color: transparent; |
||||
border-radius: 0; |
||||
} |
||||
|
||||
.date { |
||||
font-weight: 600; |
||||
} |
||||
|
||||
.content > *:first-child { |
||||
margin-top: 1rem; |
||||
} |
||||
|
||||
.content ul, |
||||
.content ol { |
||||
padding: 0 1rem; |
||||
} |
||||
} |
@ -1,42 +0,0 @@ |
||||
import React, { ReactNode } from "react"; |
||||
|
||||
import { Link } from "./Link"; |
||||
|
||||
import styles from "./MiniNewsCard.module.css"; |
||||
|
||||
interface MiniNewsCardProps { |
||||
date: Date; |
||||
author: string; |
||||
children: ReactNode; |
||||
permalink: string; |
||||
fit?: boolean; |
||||
} |
||||
|
||||
export const MiniNewsCard: React.FC<MiniNewsCardProps> = ({ |
||||
date, |
||||
author, |
||||
children, |
||||
permalink, |
||||
fit = false, |
||||
}) => { |
||||
const classes = fit ? [styles.card, styles.fit] : [styles.card]; |
||||
|
||||
return ( |
||||
<article className={classes.join(" ")}> |
||||
<h1 className={styles.date}> |
||||
<time dateTime={date.toISOString()}> |
||||
{date.toLocaleDateString("en-US", { |
||||
year: "numeric", |
||||
month: "long", |
||||
day: "numeric", |
||||
})} |
||||
</time> |
||||
</h1> |
||||
<address className={styles.author}>{author}</address> |
||||
<div className={styles.content}>{children}</div> |
||||
<Link href={permalink}> |
||||
<span className={styles.mobileLearnMore}>Learn more</span> |
||||
</Link> |
||||
</article> |
||||
); |
||||
}; |
Loading…
Reference in new issue