Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove local search #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
84 changes: 0 additions & 84 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,89 +39,5 @@ module.exports = {
// this (optional) plugin enables Progressive Web App + Offline functionality
// To learn more, visit: https://gatsby.dev/offline
// `gatsby-plugin-offline`,
{
resolve: "gatsby-plugin-local-search",
options: {
// A unique name for the search index. This should be descriptive of
// what the index contains. This is required.
name: "products",

// Set the search engine to create the index. This is required.
// The following engines are supported: flexsearch, lunr
engine: "flexsearch",

// GraphQL query used to fetch all data for the search index. This is
// required.
query: `
{
allProductsJson {
edges {
node {
_id
title
price
unit
min_quantity
max_quantity
slug
description
images {
childImageSharp {
fluid(maxWidth: 1080) {
base64
aspectRatio
src
srcSet
sizes
}
}
}
}
}
}
}
`,

// Field used as the reference value for each document.
// Default: 'id'.
ref: "_id",

// List of keys to index. The values of the keys are taken from the
// normalizer function below.
// Default: all fields
index: ['title'],

// List of keys to store and make available in your UI. The values of
// the keys are taken from the normalizer function below.
// Default: all fields
store: [
"_id",
"title",
"price",
"unit",
"min_quantity",
"max_quantity",
"slug",
"description",
"images",
],

// Function used to map the result from the GraphQL query. This should
// return an array of items to index in the form of flat objects
// containing properties to index. This is required.
normalizer: ({ data }) =>
data.allProductsJson.edges.map(({ node }) => ({
_id: node._id,
title: node.title,
price: node.price,
unit: node.unit,
min_quantity: node.min_quantity,
max_quantity: node.max_quantity,
slug: node.slug,
description: node.description,
images: node.images,
})),
},
},
],
}
6 changes: 0 additions & 6 deletions src/components/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import BaseButton from "./baseButton"
import ButtonCart from "./buttonCart"
import ButtonCatalog from "./buttonCatalog"

import Search from "./search"
// import SearchBoxBase from "./searchBoxBase"
// import SearchBox from "./searchBox"
// import SearchBoxMobile from "./searchBoxMobile"

const Header = () => {
const [state, dispatch] = useContext(CartContext)
const [miscState, miscDispatch] = useContext(MiscContext)
Expand Down Expand Up @@ -48,7 +43,6 @@ const Header = () => {
</div>
<div className="col-b">
<div className="searchBoxWrapper">
<Search />
</div>
</div>
<div className="col-c">
Expand Down
102 changes: 0 additions & 102 deletions src/components/search.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/components/useSearch.js

This file was deleted.

43 changes: 0 additions & 43 deletions src/pages/buscar.js

This file was deleted.