From 81f2ba810a751dfd952ea5ddfe393d373890e07a Mon Sep 17 00:00:00 2001 From: Kevin Green Date: Mon, 25 Sep 2023 18:15:37 -0700 Subject: [PATCH] add the product landing, render out the modules on the page --- app/queries/sanity.js | 15 +++++++++++++++ app/routes/($locale)._index.jsx | 5 ----- app/styles/app.css | 9 +++------ 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/app/queries/sanity.js b/app/queries/sanity.js index 20624d7..3aa9a41 100644 --- a/app/queries/sanity.js +++ b/app/queries/sanity.js @@ -336,6 +336,21 @@ export const QUERY_PRODUCT = (slug) => groq`*[ } ` +export const QUERY_PRODUCT_LANDING = (slug) => groq`*[ + _type == 'productLanding' && + slug.current == "${slug}" && + !(_id in path("drafts.**")) + ][0] { + ...productReference-> { + ${productQuery} + }, + 'overrideExperience': { + ${productQuery}, + 'slug': slug.current + } + } +` + export const QUERY_PAGE = (slug) => groq`*[ _type == 'page' && slug.current == "${slug}" && diff --git a/app/routes/($locale)._index.jsx b/app/routes/($locale)._index.jsx index aa66bc7..45ec876 100644 --- a/app/routes/($locale)._index.jsx +++ b/app/routes/($locale)._index.jsx @@ -16,7 +16,6 @@ import PageComponentList from '~/components/PageComponentList' export async function loader({context}) { const sanityData = await context.sanity.fetch(QUERY_HOME) - console.log('sanityData', sanityData) const sanityPage = sanityData.homepage // console.log('sanity page', sanityPage) @@ -29,10 +28,6 @@ export async function loader({context}) { } }) - sanityData.homepage.modules.forEach(module => { - console.log('module', module) - }) - const shopifyProducts = await context.storefront.query(SHOPIFY_PRODUCTS_QUERY, { variables: { ids: [...new Set(productIds)], diff --git a/app/styles/app.css b/app/styles/app.css index 46f85ba..65f3e29 100644 --- a/app/styles/app.css +++ b/app/styles/app.css @@ -1494,6 +1494,9 @@ select { .rounded-\[20px\] { border-radius: 20px; } +.rounded-\[4px\] { + border-radius: 4px; +} .rounded-\[5px\] { border-radius: 5px; } @@ -1509,9 +1512,6 @@ select { .rounded-sm { border-radius: 0.125rem; } -.rounded-\[4px\] { - border-radius: 4px; -} .border { border-width: 1px; } @@ -1829,9 +1829,6 @@ select { .opacity-60 { opacity: 0.6; } -.opacity-75 { - opacity: 0.75; -} .outline { outline-style: solid; }