Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/add review card custom section #666

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cms/faststore/sections.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"name": "CustomReviewCard",
"schema": {
"title": "Custom Review Card",
"description": "Testing ReviewCard Component",
"type": "object",
"properties": {}
}
}
]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "faststore test"
},
"dependencies": {
"@faststore/cli": "^3.9.3",
"@faststore/cli": "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/cli",
"next": "^13.5.6",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
33 changes: 33 additions & 0 deletions src/components/CustomReviewCard/CustomReviewCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ReviewCard as UIReviewCard } from "@faststore/ui";

import styles from "./customReviewCard.module.scss";

export default function CustomReviewCard() {
return (
<section className={styles.customReviewCard}>
<UIReviewCard
reviewHeadline="Decent, but some issues"
reviewRating={5}
reviewText="I’ve been using these headphones daily for the past month, and they’ve exceeded all my expectations. Right out of the box, they feel premium, with a sleek design and sturdy build that gives confidence in their."
reviewDate={new Date()}
isVerified
author="Sophia Carter"
/>
<UIReviewCard
reviewHeadline="Decent, but some issues"
reviewRating={3}
reviewText="I’ve been using these headphones daily for the past month, and they’ve exceeded all my expectations. Right out of the box, they feel premium, with a sleek design and sturdy build that gives confidence in their durability. Once you put them on, you’ll notice how well-padded the earcups and headband are, making them incredibly comfortable, even for long listening sessions. I’ve been using these headphones daily for the past month, and they’ve exceeded all my expectations. Right out of the box, they feel premium, with a sleek design and sturdy build that gives confidence in their durability. Once you put them on, you’ll notice how well-padded the earcups and headband are, making them incredibly comfortable, even for long listening sessions."
reviewDate={new Date()}
isVerified
author="Sophia Carter"
/>
<UIReviewCard
reviewHeadline="Mind-Blowing Sound Quality, Superior Comfort, and Unmatched Noise-Canceling ind-Blowing Sound Quality, Superior Comfort, and Unmatched Noise-Canceling Mind-Blowing Sound Quality, Superior Comfort, and Unmatched Noise-Canceling ind-Blowing Sound Quality, Superior Comfort, and Unmatched Noise-Canceling"
reviewRating={1}
reviewText="The headphones are good, but not great. Sound is decent, but I found the bass a bit underwhelming. The fit is snug, which can be good for some, but it feels tight after about an hour of use. Build quality is okay, but they don’t feel very durable. If you’re on a budget, they’ll do the job, but they’re not perfect."
reviewDate={new Date("2024-06-01")}
author="Sophia Carter"
/>
</section>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.customReviewCard {
padding: 40px;

@import "@faststore/ui/src/components/atoms/Icon/styles";
@import "@faststore/ui/src/components/atoms/Link/styles";
@import "@faststore/ui/src/components/molecules/Tooltip/styles";
@import "@faststore/ui/src/components/molecules/Rating/styles";
@import "@faststore/ui/src/components/molecules/ReviewCard/styles";
}
3 changes: 3 additions & 0 deletions src/components/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CustomReviewCard from "./CustomReviewCard/CustomReviewCard";

export default { CustomReviewCard };
79 changes: 33 additions & 46 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1156,10 +1156,9 @@
dependencies:
fast-deep-equal "^3.1.3"

"@faststore/api@^3.9.2":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@faststore/api/-/api-3.9.2.tgz#96d83e351be85cdcd7646a8520293f2f446ce69d"
integrity sha512-TEA6I+fOjHnsVxtN703Fc2vXSZqW06auQzR7RcM1fdsDw1RFODD2shwVO1NqMFd8RA2ld/FLpyQW0sqb/PbG7g==
"@faststore/api@https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/api":
version "3.11.3"
resolved "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/api#5135ad00c187017cd427652dda670d4ae905dbe1"
dependencies:
"@envelop/on-resolve" "^4.1.1"
"@graphql-tools/load-files" "^7.0.0"
Expand All @@ -1176,13 +1175,12 @@
p-limit "^3.1.0"
sanitize-html "^2.11.0"

"@faststore/cli@^3.9.3":
version "3.9.3"
resolved "https://registry.yarnpkg.com/@faststore/cli/-/cli-3.9.3.tgz#2d62376160025ba9ecc15985fe165d0499bc3a01"
integrity sha512-Vi0nmI7yqYbmuz0PAlEQ4JD5qbrTsgk0dGy0bET1s/vkFcBjY9qXdHdkGscJbckp8ikdgjGP3/GBI6wWsSpAow==
"@faststore/cli@https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/cli":
version "3.11.3"
resolved "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/cli#93ea55b043bc48ec58259e8c51b3cf8d941c3a1e"
dependencies:
"@antfu/ni" "^0.21.12"
"@faststore/core" "^3.9.3"
"@faststore/core" "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/core"
"@inquirer/prompts" "^5.1.2"
"@oclif/core" "^1.16.4"
"@oclif/plugin-help" "^5"
Expand All @@ -1195,28 +1193,27 @@
ora "5.4.1"
path "^0.12.7"

"@faststore/components@^3.9.2":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@faststore/components/-/components-3.9.2.tgz#0502a1c101f1f26660b284082ef6852814bbe5fb"
integrity sha512-tmsDJJLjyhxWZpM4OCJqrNizR+Xp/TZJRKI7hz4WPvvFuKp1FJjOpRNAVI2JWqQ35Rm/TKT3eF9W54GD/7DyNA==
"@faststore/components@https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/components":
version "3.11.3"
uid "14c1b7799a33994e417785f2a7484c6430fcab25"
resolved "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/components#14c1b7799a33994e417785f2a7484c6430fcab25"

"@faststore/core@^3.9.3":
version "3.9.3"
resolved "https://registry.yarnpkg.com/@faststore/core/-/core-3.9.3.tgz#7b01f7b0f9fa0bcd8101c706632fc65b70d93684"
integrity sha512-u+Urbmh/hvQM/WZTu5xxLrVKrqcb+W+hsvPJCAv45BMDRJrvYwjcvMbk2LU1i905vfh7SrqChxuto2LXmeZOBA==
"@faststore/core@https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/core":
version "3.11.3"
resolved "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/core#7860600c7ae8a5290847dc621f399297cc55bd73"
dependencies:
"@antfu/ni" "^0.21.12"
"@builder.io/partytown" "^0.6.1"
"@envelop/core" "^5.0.2"
"@envelop/graphql-jit" "^8.0.3"
"@envelop/parser-cache" "^6.0.2"
"@envelop/validation-cache" "^6.0.2"
"@faststore/api" "^3.9.2"
"@faststore/components" "^3.9.2"
"@faststore/graphql-utils" "^3.9.2"
"@faststore/lighthouse" "^3.9.2"
"@faststore/sdk" "^3.9.2"
"@faststore/ui" "^3.9.2"
"@faststore/api" "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/api"
"@faststore/components" "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/components"
"@faststore/graphql-utils" "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/graphql-utils"
"@faststore/lighthouse" "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/lighthouse"
"@faststore/sdk" "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/sdk"
"@faststore/ui" "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/ui"
"@graphql-codegen/cli" "5.0.2"
"@graphql-codegen/client-preset" "4.2.6"
"@graphql-codegen/typescript" "4.0.7"
Expand Down Expand Up @@ -1250,31 +1247,26 @@
style-loader "^3.3.1"
swr "^1.3.0"
tsx "^4.6.2"
typescript "4.7.3"

"@faststore/graphql-utils@^3.9.2":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@faststore/graphql-utils/-/graphql-utils-3.9.2.tgz#24564be4a06942d2fb5c1f8a620c1cf47d272af8"
integrity sha512-AJOkbMn843r1bbpmETCasVgMnc5022B1xbPUhj/d3Ow5jn4tMLhA4B4v2hFfu4KZcaMpweyfF9MOGP5Yr1VfsQ==
"@faststore/graphql-utils@https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/graphql-utils":
version "3.11.3"
resolved "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/graphql-utils#20e00464b3bf3d25ebf9e09b57b165c4e627ab5d"

"@faststore/lighthouse@^3.9.2":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@faststore/lighthouse/-/lighthouse-3.9.2.tgz#78c9b4af89b9b5c284a1b866708abf0381fe4c1d"
integrity sha512-0bYezCdmZ9NF1Fq/+98d7pzpT33eAp/WXM8edz/pqupwg7pYu863Yzkuyhk1BaWU6pf3fR1JgJ+9vqNI0FXraA==
"@faststore/lighthouse@https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/lighthouse":
version "3.11.3"
resolved "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/lighthouse#df78fbe8cfa995cbb27739beeb6e80b1b5dd89ca"

"@faststore/sdk@^3.9.2":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@faststore/sdk/-/sdk-3.9.2.tgz#b542908d033f3b617896a09c6353ecec7527b605"
integrity sha512-qKzqJMQtCJ1annUUjxOPlSGVF4KYsWYOkNwKR109jbf9KA1Ws+CphSVtiLCHDdhconl4Kn7Aoa5S+46Alrh02A==
"@faststore/sdk@https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/sdk":
version "3.11.3"
resolved "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/sdk#2a73a7381b6c7c6cd09b1b50babb64b187015651"
dependencies:
idb-keyval "^5.1.3"

"@faststore/ui@^3.9.2":
version "3.9.2"
resolved "https://registry.yarnpkg.com/@faststore/ui/-/ui-3.9.2.tgz#6897d8a9b0a55a83deeaf8874e7fa07230cc554a"
integrity sha512-VDrdZGjAz7VXRBPhOklvhple4rF+ZPTR1Dfj2uLB7FGnpeBiG+e9qC79Z82zd9NgHi/tHuTzrBe26bIt0jYaxA==
"@faststore/ui@https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/ui":
version "3.11.3"
resolved "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/ui#ee3ce31469740c6fe964f6e8332f33a1521b17b6"
dependencies:
"@faststore/components" "^3.9.2"
"@faststore/components" "https://pkg.csb.dev/vtex/faststore/commit/951ff450/@faststore/components"
include-media "^1.4.10"
modern-normalize "^1.1.0"
react-swipeable "^7.0.0"
Expand Down Expand Up @@ -8029,11 +8021,6 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

[email protected]:
version "4.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d"
integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==

typescript@^4.9.4:
version "4.9.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
Expand Down