Skip to content

Commit

Permalink
add the product landing, render out the modules on the page
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkevingreen committed Sep 26, 2023
1 parent 6313975 commit 81f2ba8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
15 changes: 15 additions & 0 deletions app/queries/sanity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}" &&
Expand Down
5 changes: 0 additions & 5 deletions app/routes/($locale)._index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)],
Expand Down
9 changes: 3 additions & 6 deletions app/styles/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,9 @@ select {
.rounded-\[20px\] {
border-radius: 20px;
}
.rounded-\[4px\] {
border-radius: 4px;
}
.rounded-\[5px\] {
border-radius: 5px;
}
Expand All @@ -1509,9 +1512,6 @@ select {
.rounded-sm {
border-radius: 0.125rem;
}
.rounded-\[4px\] {
border-radius: 4px;
}
.border {
border-width: 1px;
}
Expand Down Expand Up @@ -1829,9 +1829,6 @@ select {
.opacity-60 {
opacity: 0.6;
}
.opacity-75 {
opacity: 0.75;
}
.outline {
outline-style: solid;
}
Expand Down

0 comments on commit 81f2ba8

Please sign in to comment.