-
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.
Merge pull request #57 from buildheadless/related-products
Add related products section
- Loading branch information
Showing
31 changed files
with
259 additions
and
328 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
templates/hydrogen-theme/app/components/blocks/AddToCartButtonBlock.tsx
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
6 changes: 3 additions & 3 deletions
6
templates/hydrogen-theme/app/components/blocks/ShopifyDescriptionBlock.tsx
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
6 changes: 3 additions & 3 deletions
6
templates/hydrogen-theme/app/components/blocks/ShopifyTitleBlock.tsx
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,14 @@ | ||
import type {InferType} from 'groqd'; | ||
import type {ProductQuery} from 'storefrontapi.generated'; | ||
|
||
import {useProduct} from '@shopify/hydrogen-react'; | ||
import {useLoaderData} from '@remix-run/react'; | ||
|
||
import type {SHOPIFY_TITLE_BLOCK} from '~/qroq/blocks'; | ||
import type {loader} from '~/routes/($locale).products.$productHandle'; | ||
|
||
export type ShopifyTitleBlockProps = InferType<typeof SHOPIFY_TITLE_BLOCK>; | ||
|
||
export function ShopifyTitleBlock(props: ShopifyTitleBlockProps) { | ||
const {product} = useProduct() as {product: ProductQuery['product']}; | ||
const {product} = useLoaderData<typeof loader>(); | ||
|
||
return <h1>{product?.title}</h1>; | ||
} |
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
9 changes: 4 additions & 5 deletions
9
templates/hydrogen-theme/app/components/product/MediaGallery.tsx
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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.