Add fit prop to NewsCard
This commit is contained in:
parent
19617b8bad
commit
d7b2d9cf34
|
@ -5,6 +5,12 @@
|
||||||
border-radius: calc(20rem / 16);
|
border-radius: calc(20rem / 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fit.card {
|
||||||
|
max-width: unset;
|
||||||
|
padding: unset;
|
||||||
|
border-radius: unset;
|
||||||
|
}
|
||||||
|
|
||||||
.date {
|
.date {
|
||||||
font-size: calc(18rem / 16);
|
font-size: calc(18rem / 16);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
|
@ -6,15 +6,19 @@ interface NewsCardProps {
|
||||||
date: Date;
|
date: Date;
|
||||||
author: string;
|
author: string;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
|
fit?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const NewsCard: React.FC<NewsCardProps> = ({
|
export const NewsCard: React.FC<NewsCardProps> = ({
|
||||||
date,
|
date,
|
||||||
author,
|
author,
|
||||||
children,
|
children,
|
||||||
|
fit = false,
|
||||||
}) => {
|
}) => {
|
||||||
|
const classes = fit ? [styles.card, styles.fit] : [styles.card];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<article className={styles.card}>
|
<article className={classes.join(" ")}>
|
||||||
<h1 className={styles.date}>
|
<h1 className={styles.date}>
|
||||||
<time dateTime={date.toISOString()}>
|
<time dateTime={date.toISOString()}>
|
||||||
{date.toLocaleDateString("en-US", {
|
{date.toLocaleDateString("en-US", {
|
||||||
|
|
Loading…
Reference in New Issue