Skip to content

Commit bd68ee4

Browse files
committed
fixed error on build
1 parent 07dfbf5 commit bd68ee4

File tree

8 files changed

+9
-47
lines changed

8 files changed

+9
-47
lines changed

components/ViewInventory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class ViewInventory extends React.Component {
5353
return (
5454
<div className="border-b py-10" key={item.id}>
5555
<div className="flex items-center">
56-
<Link href={slugify(item.name)}>
56+
<Link href={`/product/${slugify(item.name)}`}>
5757
<a aria-label={item.name}>
5858
<Image className="w-32 m-0" src={item.image} alt={item.name} />
5959
</a>
@@ -92,7 +92,7 @@ class ViewInventory extends React.Component {
9292
return (
9393
<div className="border-b py-10" key={item.id}>
9494
<div className="flex items-center">
95-
<Link href={slugify(item.name)}>
95+
<Link href={`/product/${slugify(item.name)}`}>
9696
<a>
9797
<Image className="w-32 m-0" src={item.image} alt={item.name} />
9898
</a>

next.config.js

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

pages/_app.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
import '../styles/globals.css'
22
import Layout from '../layouts/layout'
3-
/* Uncomment for dynamic nav
43
import fetchCategories from '../utils/categoryProvider'
5-
*/
64

7-
function Ecommerce({ Component, pageProps }) {
8-
const categories = ['new arrivals', 'sofas', 'living room', 'on sale', 'chairs']
5+
function Ecommerce({ Component, pageProps, categories }) {
96
return (
107
<Layout categories={categories}>
118
<Component {...pageProps} />
129
</Layout>
1310
)
1411
}
1512

16-
/* Uncomment for dynamic nav
1713
Ecommerce.getInitialProps = async () => {
1814
const categories = await fetchCategories()
1915
return {
2016
categories
2117
}
2218
}
23-
*/
2419

2520
export default Ecommerce

pages/api/hello.js

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

pages/api/inventory.js

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

serverless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
jamstackEcommerceNext:
1+
nextEcommerce:
22
component: "@sls-next/serverless-component@1.18.0"
33
# inputs:
44
# domain: "yourdomain.com"

utils/helpers.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ function slugify(string) {
1414
}
1515

1616
function titleIfy(slug) {
17-
var words = slug.split('-');
17+
var words = slug.split('-')
1818
for (var i = 0; i < words.length; i++) {
19-
var word = words[i];
20-
words[i] = word.charAt(0).toUpperCase() + word.slice(1);
19+
var word = words[i]
20+
words[i] = word.charAt(0).toUpperCase() + word.slice(1)
2121
}
22-
return words.join(' ');
22+
return words.join(' ')
2323
}
2424

2525
function getTrimmedString(string, length = 8) {

utils/inventoryProvider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import inventory from './inventory';
1+
import inventory from './inventory'
22

33
/*
44
Inventory items should adhere to the following schema:

0 commit comments

Comments
 (0)