diff --git a/app/routes/($locale)._index.jsx b/app/routes/($locale)._index.jsx index 02ad51a..39cbbac 100644 --- a/app/routes/($locale)._index.jsx +++ b/app/routes/($locale)._index.jsx @@ -10,6 +10,11 @@ export async function loader({context}) { const products = await context.storefront.query(PRODUCT_QUERY) const articles = await context.storefront.query(ARTICLES_QUERY) + const sanityPage = await context.sanity.fetch(` + *[_type == "home"] { + ... + }[0]`) + // We're not covering accounts/auth in this class // const customerAccessToken = await context.session.get('customerAccessToken'); // const customer = customerAccessToken ? @@ -17,6 +22,7 @@ export async function loader({context}) { // : false return { + sanityPage, collections, pages, articles, @@ -36,7 +42,7 @@ export const handle = { export default function Homepage() { const fetcher = useFetcher(); - const {collections, pages, products, articles} = useLoaderData() + const {collections, sanityPage, pages, products, articles} = useLoaderData() const pagesArray = flattenConnection(pages.pages) const productArray = flattenConnection(products.products) @@ -46,6 +52,9 @@ export default function Homepage() { return (