-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from "react"; | ||
import styles from "./card.module.css"; | ||
|
||
interface CardProps { | ||
title: string; | ||
excerpt: string; | ||
url: string; | ||
author: string; | ||
content: string; | ||
} | ||
|
||
const Card: React.FC<CardProps> = ({ title, excerpt, url, author, content }) => { | ||
Check failure on line 12 in website/src/components/BlogCard/Card.tsx GitHub Actions / check (lint:ts)
Check failure on line 12 in website/src/components/BlogCard/Card.tsx GitHub Actions / check (lint:ts)
|
||
return ( | ||
<div className={styles.card}> | ||
<div className={styles.cardHeader} onClick={() => (window.location.href = url)}> | ||
Check warning on line 15 in website/src/components/BlogCard/Card.tsx GitHub Actions / check (lint:ts)
Check warning on line 15 in website/src/components/BlogCard/Card.tsx GitHub Actions / check (lint:ts)
Check failure on line 15 in website/src/components/BlogCard/Card.tsx GitHub Actions / check (lint:ts)
Check failure on line 15 in website/src/components/BlogCard/Card.tsx GitHub Actions / check (lint:ts)
|
||
<h2 className={styles.title}>{title}</h2> | ||
</div> | ||
<div className={styles.cardBody}> | ||
<p className={styles.excerpt}>{excerpt}</p> | ||
<button onClick={() => (window.location.href = url)} className={styles.readMoreButton}> | ||
Check failure on line 20 in website/src/components/BlogCard/Card.tsx GitHub Actions / check (lint:ts)
|
||
Read More | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Card; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.container { | ||
padding: 16px; | ||
} | ||
|
||
.cardsGrid { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | ||
gap: 16px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.card { | ||
border: 1px solid #ccc; | ||
border-radius: 8px; | ||
padding: 16px; | ||
margin-bottom: 16px; | ||
transition: box-shadow 0.3s ease; | ||
cursor: pointer; | ||
} | ||
|
||
.card:hover { | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
.cardHeader { | ||
margin-bottom: 8px; | ||
} | ||
|
||
.title { | ||
font-size: 24px; | ||
font-weight: bold; | ||
color: #333; | ||
} | ||
|
||
.cardBody { | ||
font-size: 16px; | ||
color: #666; | ||
} | ||
|
||
.excerpt { | ||
margin-bottom: 8px; | ||
} | ||
|
||
.readMoreButton { | ||
background-color: #0070f3; | ||
color: #fff; | ||
border: none; | ||
padding: 8px 16px; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
transition: background-color 0.3s ease; | ||
} | ||
|
||
.readMoreButton:hover { | ||
background-color: #005bb5; | ||
} | ||
|
||
.cardsGrid { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); | ||
gap: 16px; | ||
} |