Skip to content

Commit 82ea8f1

Browse files
authored
Merge pull request #1099 from w3bdesign/develop
Prettier
2 parents b18b755 + 66926aa commit 82ea8f1

11 files changed

+2381
-765
lines changed

package-lock.json

+2,359-743
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nextjs-woocommerce",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",

src/components/AlgoliaSearch/AlgoliaSearchBox.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import SearchResults from './SearchResults.component';
66

77
const searchClient = algoliasearch(
88
process.env.NEXT_PUBLIC_ALGOLIA_APP_ID ?? 'changeme',
9-
process.env.NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY ?? 'changeme'
9+
process.env.NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY ?? 'changeme',
1010
);
1111

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

src/components/AlgoliaSearch/MobileSearch.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import SearchResults from './SearchResults.component';
66

77
const searchClient = algoliasearch(
88
process.env.NEXT_PUBLIC_ALGOLIA_APP_ID ?? 'changethis',
9-
process.env.NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY ?? 'changethis'
9+
process.env.NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY ?? 'changethis',
1010
);
1111

1212
/**

src/components/Cart/CartContents.component.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ const CartContents = () => {
6969
refetch();
7070
}, 3000);
7171
},
72-
}
72+
},
7373
);
7474

7575
const handleRemoveProductClick = (
7676
cartKey: string,
77-
products: IProductRootObject[]
77+
products: IProductRootObject[],
7878
) => {
7979
if (products.length) {
8080
// By passing the newQty to 0 in updateCart Mutation, it will remove the item.
@@ -123,7 +123,7 @@ const CartContents = () => {
123123
handleButtonClick={() =>
124124
handleRemoveProductClick(
125125
item.key,
126-
data.cart.contents.nodes
126+
data.cart.contents.nodes,
127127
)
128128
}
129129
>
@@ -155,7 +155,7 @@ const CartContents = () => {
155155
item.key,
156156
data.cart.contents.nodes,
157157
updateCart,
158-
updateCartProcessing
158+
updateCartProcessing,
159159
);
160160
}}
161161
/>

src/components/Checkout/CheckoutForm.component.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const CheckoutForm = () => {
9595
setRequestError(error);
9696
refetch();
9797
},
98-
}
98+
},
9999
);
100100

101101
useEffect(() => {

src/components/Product/DisplayProducts.component.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const DisplayProducts = ({ products }: IDisplayProductsProps) => (
8080
>
8181
<Link
8282
href={`/produkt/${encodeURIComponent(
83-
slug
83+
slug,
8484
)}?id=${encodeURIComponent(databaseId)}`}
8585
>
8686
<span>
@@ -106,7 +106,7 @@ const DisplayProducts = ({ products }: IDisplayProductsProps) => (
106106

107107
<Link
108108
href={`/produkt/${encodeURIComponent(
109-
slug
109+
slug,
110110
)}?id=${encodeURIComponent(databaseId)}`}
111111
>
112112
<span>
@@ -136,7 +136,7 @@ const DisplayProducts = ({ products }: IDisplayProductsProps) => (
136136
)}
137137
</div>
138138
);
139-
}
139+
},
140140
)
141141
) : (
142142
<div className="mx-auto text-xl font-bold text-center text-gray-800 no-underline uppercase">

src/components/Product/SingleProduct.component.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const SingleProduct = ({ product }: IProductRootObject) => {
4040
if (process.browser) {
4141
DESCRIPTION_WITHOUT_HTML = new DOMParser().parseFromString(
4242
description,
43-
'text/html'
43+
'text/html',
4444
).body.textContent;
4545
}
4646

@@ -129,7 +129,7 @@ const SingleProduct = ({ product }: IProductRootObject) => {
129129
{filteredName} - ({stockQuantity} på lager)
130130
</option>
131131
);
132-
}
132+
},
133133
)}
134134
</select>
135135
</p>

src/tests/Produkter/Produkter.spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test.describe('Produkter', () => {
3131

3232
// Check that that Handlekurv is visible
3333
await expect(
34-
page.locator('section').filter({ hasText: 'Handlekurv' })
34+
page.locator('section').filter({ hasText: 'Handlekurv' }),
3535
).toBeVisible();
3636

3737
// Check that we can go to Kasse
@@ -43,7 +43,7 @@ test.describe('Produkter', () => {
4343
});
4444

4545
await expect(
46-
page.locator('section').filter({ hasText: 'Kasse' })
46+
page.locator('section').filter({ hasText: 'Kasse' }),
4747
).toBeVisible();
4848

4949
// Check that we can type something in Billing fields
@@ -53,7 +53,7 @@ test.describe('Produkter', () => {
5353
await page.getByPlaceholder('Etternavn').waitFor();
5454

5555
await expect(page.getByPlaceholder('Etternavn')).toHaveValue(
56-
'testetternavn'
56+
'testetternavn',
5757
);
5858
});
5959
});

src/utils/apollo/ApolloClient.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const afterware = new ApolloLink((operation, forward) =>
5656
}
5757

5858
return response;
59-
})
59+
}),
6060
);
6161

6262
const clientSide = typeof window === 'undefined';
@@ -69,8 +69,8 @@ const client = new ApolloClient({
6969
createHttpLink({
7070
uri: process.env.NEXT_PUBLIC_GRAPHQL_URL,
7171
fetch,
72-
})
73-
)
72+
}),
73+
),
7474
),
7575
cache: new InMemoryCache(),
7676
});

src/utils/functions/functions.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export const getFormattedCart = (data: IFormattedCartProps) => {
174174
// Convert price to a float value
175175
const convertedCurrency = givenProducts[Number(i)].total.replace(
176176
/[^0-9.-]+/g,
177-
''
177+
'',
178178
);
179179

180180
product.productId = givenProduct.productId;
@@ -253,7 +253,7 @@ export const createCheckoutData = (order: ICheckoutDataProps) => ({
253253
export const getUpdatedItems = (
254254
products: IProductRootObject[],
255255
newQty: number,
256-
cartKey: string
256+
cartKey: string,
257257
) => {
258258
// Create an empty array.
259259

@@ -290,7 +290,7 @@ export const handleQuantityChange = (
290290
cartKey: string,
291291
cart: IProductRootObject[],
292292
updateCart: (variables: IUpdateCartRootObject) => void,
293-
updateCartProcessing: boolean
293+
updateCartProcessing: boolean,
294294
) => {
295295
if (process.browser) {
296296
event.stopPropagation();

0 commit comments

Comments
 (0)