-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bac1c4f
commit 8322852
Showing
10 changed files
with
275 additions
and
11 deletions.
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
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,10 @@ | ||
import Image from "next/image"; | ||
|
||
const LazyBanner = ({ data }) => { | ||
const { src, alt, width,height } = data; | ||
return ( | ||
<Image src={src} width={width} height={height} alt={alt} /> | ||
); | ||
} | ||
|
||
export default LazyBanner; |
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,44 @@ | ||
import React, { useState } from 'react'; | ||
import reviewCardStyle from '@/styles/ReviewsCard.module.css'; | ||
import Image from 'next/image'; | ||
import { BiLinkExternal } from 'react-icons/bi' | ||
|
||
const Reviews = ({ data }) => { | ||
const { review, images } = data; | ||
const { author, author_details, content, url } = review; | ||
const { name, username, avatar_path } = author_details; | ||
const [showFullContent, setShowFullContent] = useState(false); | ||
|
||
const toggleContent = () => { | ||
setShowFullContent(!showFullContent); | ||
}; | ||
|
||
return ( | ||
<div className={reviewCardStyle.card}> | ||
<div className={reviewCardStyle.top}> | ||
<div className={reviewCardStyle.name}> | ||
<div className={reviewCardStyle.img}> | ||
{avatar_path && ( | ||
<Image | ||
src={`${images.base_url}/original/${avatar_path}`} | ||
alt={`${name} PFP`} | ||
width={100} | ||
height={100} | ||
/> | ||
)} | ||
</div> | ||
<div> | ||
<h3>{name || author}</h3> | ||
<span>@{username}</span> | ||
</div> | ||
</div> | ||
<a href={url}><BiLinkExternal className={reviewCardStyle.link} /></a> | ||
</div> | ||
{showFullContent ? <p>{content}</p> : <p>{content.slice(0, 250)}...</p>} | ||
{!showFullContent && <button onClick={toggleContent}>Read More</button>} | ||
{showFullContent && <button onClick={toggleContent}>Read Less</button>} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Reviews; |
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
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,67 @@ | ||
.card { | ||
border: 2px #2CEC65 solid; | ||
border-radius: 10px; | ||
padding: 1rem; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
height: 100%; | ||
} | ||
.card .top { | ||
display: flex; | ||
gap: 1rem; | ||
justify-content: space-between; | ||
} | ||
.card .top .name { | ||
display: flex; | ||
gap: 1rem; | ||
align-items: center; | ||
} | ||
.card .top .name .img { | ||
width: 3rem; | ||
height: 3rem; | ||
overflow: hidden; | ||
border-radius: 100px; | ||
} | ||
.card .top .name .img img { | ||
-o-object-fit: cover; | ||
object-fit: cover; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
.card .top .name div { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 0.5rem; | ||
} | ||
.card .top .name div h3 { | ||
color: white; | ||
} | ||
.card .top .name div span { | ||
color: #2CEC65; | ||
font-size: 0.9rem; | ||
} | ||
.card .top .link { | ||
color: #2CEC65; | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
} | ||
.card p { | ||
font-size: 1rem; | ||
border: 1px #2CEC65 solid; | ||
letter-spacing: 1px; | ||
color: white; | ||
padding: 1rem; | ||
border-radius: 10px; | ||
line-height: 25px; | ||
} | ||
.card button { | ||
background-color: #2CEC65; | ||
border: none; | ||
border-radius: 100px; | ||
color: black; | ||
font-size: 1rem; | ||
padding: 0.5rem; | ||
font-weight: 900; | ||
cursor: pointer; | ||
}/*# sourceMappingURL=ReviewsCard.module.css.map */ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,79 @@ | ||
.card { | ||
border: 2px #2CEC65 solid; | ||
border-radius: 10px; | ||
padding: 1rem; | ||
display: flex; | ||
flex-direction: column; | ||
gap: 1rem; | ||
height: 100%; | ||
|
||
|
||
|
||
.top { | ||
display: flex; | ||
gap: 1rem; | ||
justify-content: space-between; | ||
|
||
.name { | ||
display: flex; | ||
gap: 1rem; | ||
align-items: center; | ||
|
||
|
||
.img { | ||
width: 3rem; | ||
height: 3rem; | ||
overflow: hidden; | ||
border-radius: 100px; | ||
|
||
img { | ||
object-fit: cover; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
} | ||
|
||
div { | ||
display: flex; | ||
flex-direction: column; | ||
gap: .5rem; | ||
|
||
h3 { | ||
color: white; | ||
} | ||
|
||
span { | ||
color: #2CEC65; | ||
font-size: .9rem; | ||
} | ||
} | ||
} | ||
|
||
.link { | ||
color: #2CEC65; | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
} | ||
} | ||
|
||
p { | ||
font-size: 1rem; | ||
border: 1px #2CEC65 solid; | ||
letter-spacing: 1px; | ||
color: white; | ||
padding: 1rem; | ||
border-radius: 10px; | ||
line-height: 25px; | ||
} | ||
|
||
button { | ||
background-color: #2CEC65; | ||
border: none; | ||
border-radius: 100px; | ||
color: black; | ||
font-size: 1rem; | ||
padding: .5rem; | ||
font-weight: 900; | ||
cursor: pointer; | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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