Skip to content

Commit a3fbf79

Browse files
authored
Use env variables for Algolia search
Use env variables for Algolia search
2 parents 20df313 + f1a16bd commit a3fbf79

File tree

7 files changed

+21
-60
lines changed

7 files changed

+21
-60
lines changed

components/AlgoliaSearch/AlgoliaSearchBox.component.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ import algoliasearch from 'algoliasearch';
22
import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom';
33
import { useState } from 'react';
44

5-
import WOO_CONFIG from 'utils/config/nextConfig';
5+
import WOO_CONFIG from 'utils/config/nextConfig';
66
import SearchResults from './SearchResults.component';
77

88
const searchClient = algoliasearch(
9-
WOO_CONFIG.ALGOLIA_APP_ID,
10-
WOO_CONFIG.ALGOLIA_PUBLIC_API_KEY
9+
// WOO_CONFIG.ALGOLIA_APP_ID,
10+
// WOO_CONFIG.ALGOLIA_PUBLIC_API_KEY
11+
process.env.ALGOLIA_APP_ID,
12+
process.env.ALGOLIA_PUBLIC_API_KEY
1113
);
1214

1315
// https://www.algolia.com/doc/api-reference/widgets/instantsearch/react/

components/Cart/Cart.component.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { AppContext } from 'utils/context/AppContext';
99
* Displays amount of items in cart.
1010
*/
1111
const Cart = () => {
12-
const [cart, setCart] = useContext(AppContext);
12+
const [cart] = useContext(AppContext);
1313

1414
const productsCount =
1515
null !== cart && Object.keys(cart).length ? cart.totalProductsCount : '';
@@ -18,15 +18,15 @@ const Cart = () => {
1818
<>
1919
<Link href="/handlekurv">
2020
<a
21-
className="inline-block pl-3 no-underline hover:text-black"
21+
className="inline-block pl-4 mt-4 no-underline"
2222
aria-label="Handlekurv"
2323
>
2424
<svg
25-
className="fill-current hover:text-black"
25+
className="fill-current"
2626
xmlns="http://www.w3.org/2000/svg"
27-
width="24"
28-
height="24"
29-
viewBox="0 0 24 24"
27+
width="155"
28+
height="55"
29+
viewBox="0 0 30 30"
3030
aria-label="Handlekurv"
3131
>
3232
<path
@@ -40,7 +40,7 @@ const Cart = () => {
4040
</Link>
4141
{/*Cart quantity */}
4242
{productsCount && (
43-
<span className="w-6 h-6 pb-2 -mt-6 text-center text-white bg-black rounded-full">
43+
<span className="w-6 h-6 pb-2 -mt-5 text-center text-white bg-black rounded-full">
4444
{productsCount}
4545
</span>
4646
)}

components/Header/Navbar.component.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ const Navbar = () => {
2222
<ul className="items-center justify-between pt-4 text-base text-gray-700 md:flex md:pt-0">
2323
<li>
2424
<Link href="/produkter">
25-
<a className="inline-block py-2 pr-4 no-underline hover:text-black hover:underline">
25+
<a className="inline-block py-2 pr-4 text-xl font-bold no-underline hover:underline">
2626
Produkter
2727
</a>
2828
</Link>
2929
</li>
3030
<li>
3131
<Link href="/kategorier">
32-
<a className="inline-block py-2 pr-4 no-underline hover:text-black hover:underline">
32+
<a className="inline-block py-2 pr-4 text-xl font-bold no-underline hover:underline">
3333
Kategorier
3434
</a>
3535
</Link>

package-lock.json

Lines changed: 5 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-woocommerce",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "Nextjs WooCommerce webshop",
55
"main": "index.js",
66
"scripts": {
@@ -23,7 +23,7 @@
2323
"postcss": "^8.2.1",
2424
"react": "^17.0.1",
2525
"react-dom": "^17.0.1",
26-
"react-hook-form": "^6.13.0",
26+
"react-hook-form": "^6.13.1",
2727
"react-instantsearch-dom": "^6.8.2",
2828
"react-spring": "^8.0.27",
2929
"styled-components": "^5.2.1",

postcss.config.js.example

Lines changed: 0 additions & 4 deletions
This file was deleted.

tailwind.config.js.example

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)