-
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
Showing
15 changed files
with
260 additions
and
403 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,5 +1,5 @@ | ||
export default { | ||
storeDomain: 'hydrogen-preview.myshopify.com', | ||
storefrontToken: '3b580e70970c4528da70c98e097c2fa0', | ||
storefrontApiVersion: 'unstable', | ||
storefrontApiVersion: '2022-01', | ||
}; |
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,13 +1,8 @@ | ||
import {HelmetProvider} from '@shopify/hydrogen/client'; | ||
import CartProvider from './components/CartProvider.client'; | ||
|
||
/** | ||
* Setup client context, though the children are most likely server components | ||
*/ | ||
export default function ClientApp({helmetContext, children}) { | ||
return ( | ||
<HelmetProvider context={helmetContext}> | ||
<CartProvider>{children}</CartProvider> | ||
</HelmetProvider> | ||
); | ||
export default function ClientApp({children}) { | ||
return <CartProvider>{children}</CartProvider>; | ||
} |
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
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,28 +1,32 @@ | ||
import {useShopQuery} from '@shopify/hydrogen'; | ||
import {useShopQuery, Seo} from '@shopify/hydrogen'; | ||
import gql from 'graphql-tag'; | ||
|
||
import Seo from './Seo.client'; | ||
|
||
/** | ||
* A server component that fetches a `shop.name` and sets default values and templates for every page on a website | ||
*/ | ||
export default function DefaultSeo() { | ||
const { | ||
data: { | ||
shop: {name: shopName}, | ||
shop: {name: shopName, description: shopDescription}, | ||
}, | ||
} = useShopQuery({ | ||
query: QUERY, | ||
cache: {maxAge: 60 * 60 * 12, staleWhileRevalidate: 60 * 60 * 12}, | ||
}); | ||
|
||
return <Seo shopName={shopName} />; | ||
return ( | ||
<Seo | ||
type="defaultSeo" | ||
data={{title: shopName, description: shopDescription}} | ||
/> | ||
); | ||
} | ||
|
||
const QUERY = gql` | ||
query shopName { | ||
shop { | ||
name | ||
description | ||
} | ||
} | ||
`; |
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,17 +1,14 @@ | ||
import {Money} from '@shopify/hydrogen/client'; | ||
import {useMoney} from '@shopify/hydrogen/client'; | ||
|
||
/** | ||
* A client component that renders a `Money` component for a product's compare at price | ||
*/ | ||
export default function MoneyCompareAtPrice({money}) { | ||
const {amount, currencyNarrowSymbol} = useMoney(money); | ||
return ( | ||
<Money money={money}> | ||
{({amount, currencyNarrowSymbol}) => ( | ||
<span className="line-through text-lg mr-2.5 text-gray-500"> | ||
{currencyNarrowSymbol} | ||
{amount} | ||
</span> | ||
)} | ||
</Money> | ||
<span className="line-through text-lg mr-2.5 text-gray-500"> | ||
{currencyNarrowSymbol} | ||
{amount} | ||
</span> | ||
); | ||
} |
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,18 +1,16 @@ | ||
import {Money} from '@shopify/hydrogen/client'; | ||
import {useMoney} from '@shopify/hydrogen/client'; | ||
|
||
/** | ||
* A client component that defines the currency code, currency symbol, and amount of a product | ||
*/ | ||
export default function MoneyPrice({money}) { | ||
const {amount, currencyNarrowSymbol, currencyCode} = useMoney(money); | ||
|
||
return ( | ||
<Money className="text-black text-md" money={money}> | ||
{({amount, currencyNarrowSymbol, currencyCode}) => ( | ||
<> | ||
{currencyCode} | ||
{currencyNarrowSymbol} | ||
{amount} | ||
</> | ||
)} | ||
</Money> | ||
<> | ||
{currencyCode} | ||
{currencyNarrowSymbol} | ||
{amount} | ||
</> | ||
); | ||
} |
Oops, something went wrong.