Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -4,7 +4,9 @@ exports[`useCategoryContent tests handles no data prop 1`] = `
Object {
"availableSortMethods": null,
"categoryDescription": "Jewelry category",
"categoryDisplayMode": undefined,
"categoryName": "Jewelry",
"cmsBlockContent": undefined,
"filterOptions": undefined,
"filters": null,
"items": Array [
@@ -33,7 +35,9 @@ Object {
},
],
"categoryDescription": "Jewelry category",
"categoryDisplayMode": undefined,
"categoryName": "Jewelry",
"cmsBlockContent": undefined,
"filterOptions": undefined,
"filters": Array [
Object {
Original file line number Diff line number Diff line change
@@ -27,6 +27,10 @@ export const GET_CATEGORY_CONTENT = gql`
description
url_key
url_path
display_mode
cms_block {
content
}
}
}
}
Original file line number Diff line number Diff line change
@@ -196,6 +196,14 @@ export const useCategoryContent = props => {
const availableSortMethods = sortData
? sortData.products.sort_fields.options
: null;
const categoryDisplayMode =
categoryData && categoryData.categories.items.length
? categoryData.categories.items[0].display_mode
: null;
const cmsBlockContent =
categoryData && categoryData.categories.items.length
? categoryData.categories.items[0].cms_block?.content
: null;

useEffect(() => {
if (!categoryLoading && categoryData?.categories.items.length > 0) {
@@ -220,6 +228,8 @@ export const useCategoryContent = props => {
setFilterOptions,
items,
totalCount,
totalPagesFromData
totalPagesFromData,
categoryDisplayMode,
cmsBlockContent
};
};
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.