-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix prices on slider * Add to cart from carousel * Update Slider * Update useProducts
- Loading branch information
Showing
10 changed files
with
168 additions
and
93 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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
import { SfProduct } from '@vue-storefront/unified-data-model'; | ||
|
||
export type ProductSliderProps = { | ||
products: SfProduct[]; | ||
collection?: string; | ||
className?: string; | ||
}; |
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
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,14 +1,17 @@ | ||
import { Maybe } from '@vue-storefront/unified-data-model'; | ||
import { Product } from '~/sdk/shopify/types'; | ||
|
||
export type ProductCardProps = { | ||
name: Maybe<string>; | ||
description?: Maybe<string>; | ||
imageUrl?: Maybe<string>; | ||
imageAlt?: Maybe<string>; | ||
rating?: number; | ||
ratingCount?: number; | ||
price?: number; | ||
compareAtPrice?: number; | ||
currencyCode?: string; | ||
slug?: string; | ||
className?: string; | ||
priority?: boolean; | ||
descriptionClassName: string; | ||
product: Product; | ||
}; |
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 @@ | ||
export * from './useProductRating'; |
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,19 @@ | ||
import { Product } from '~/sdk/shopify/types'; | ||
|
||
const RATING = 5; | ||
const RATING_COUNT = 5; | ||
|
||
type ProductRating = { | ||
rating: number; | ||
ratingCount: number; | ||
}; | ||
|
||
const useProductRating = (product: Product | null | undefined): ProductRating => { | ||
if (!product) { | ||
return { rating: 0, ratingCount: 1 }; | ||
} | ||
|
||
return { rating: RATING, ratingCount: RATING_COUNT }; | ||
}; | ||
|
||
export default useProductRating; |
Oops, something went wrong.