-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(website): add user testimonials
- Loading branch information
Showing
4 changed files
with
82 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.features { | ||
display: flex; | ||
align-items: center; | ||
padding: 2rem 0; | ||
padding-top: 2rem; | ||
width: 100%; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from "react"; | ||
import styles from "./styles.module.css"; | ||
|
||
const testimonials = [ | ||
{ | ||
name: "Boshen", | ||
handle: "boshen", | ||
date: "Sep 29, 2024", | ||
content: | ||
"git-cliff is amazing. I managed to use its published crates for my project's release management.", | ||
url: "https://x.com/boshen_c/status/1840391571495420362", | ||
}, | ||
]; | ||
|
||
const getRandomTestimonial = () => { | ||
const randomIndex = Math.floor(Math.random() * testimonials.length); | ||
return testimonials[randomIndex]; | ||
}; | ||
|
||
export default function Testimonials(): JSX.Element { | ||
const review = getRandomTestimonial(); | ||
|
||
return ( | ||
<div className={styles.testimonialsList}> | ||
<div className={styles.testimonial}> | ||
<p className={styles.content}> | ||
<em>"{review.content}"</em> | ||
</p> | ||
<div className={styles.details}> | ||
<span className={styles.author}> | ||
- {review.name} ( | ||
<a | ||
href={`https://github.com/${review.handle}`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
>{`@${review.handle}`}</a> | ||
) | ||
</span> | ||
<a | ||
href={review.url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
className={styles.date} | ||
> | ||
{review.date} | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.testimonialsList { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
margin: 1rem auto; | ||
max-width: 500px; | ||
padding: 0 1rem; | ||
} | ||
|
||
.testimonial { | ||
font-size: 0.9rem; | ||
line-height: 1.4; | ||
padding: 0.5rem 0; | ||
text-align: center; | ||
} | ||
|
||
.content { | ||
margin: 0; | ||
font-style: italic; | ||
} | ||
|
||
.details { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-end; | ||
font-size: 0.8rem; | ||
margin-top: 0.3rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters