Skip to content

Commit

Permalink
Merge pull request #1099 from w3bdesign/develop
Browse files Browse the repository at this point in the history
Prettier
  • Loading branch information
w3bdesign authored Jul 7, 2023
2 parents b18b755 + 66926aa commit 82ea8f1
Show file tree
Hide file tree
Showing 11 changed files with 2,381 additions and 765 deletions.
3,102 changes: 2,359 additions & 743 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-woocommerce",
"version": "1.1.6",
"version": "1.1.7",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SearchResults from './SearchResults.component';

const searchClient = algoliasearch(
process.env.NEXT_PUBLIC_ALGOLIA_APP_ID ?? 'changeme',
process.env.NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY ?? 'changeme'
process.env.NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY ?? 'changeme',
);

// https://www.algolia.com/doc/api-reference/widgets/instantsearch/react/
Expand Down
2 changes: 1 addition & 1 deletion src/components/AlgoliaSearch/MobileSearch.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import SearchResults from './SearchResults.component';

const searchClient = algoliasearch(
process.env.NEXT_PUBLIC_ALGOLIA_APP_ID ?? 'changethis',
process.env.NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY ?? 'changethis'
process.env.NEXT_PUBLIC_ALGOLIA_PUBLIC_API_KEY ?? 'changethis',
);

/**
Expand Down
8 changes: 4 additions & 4 deletions src/components/Cart/CartContents.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ const CartContents = () => {
refetch();
}, 3000);
},
}
},
);

const handleRemoveProductClick = (
cartKey: string,
products: IProductRootObject[]
products: IProductRootObject[],
) => {
if (products.length) {
// By passing the newQty to 0 in updateCart Mutation, it will remove the item.
Expand Down Expand Up @@ -123,7 +123,7 @@ const CartContents = () => {
handleButtonClick={() =>
handleRemoveProductClick(
item.key,
data.cart.contents.nodes
data.cart.contents.nodes,
)
}
>
Expand Down Expand Up @@ -155,7 +155,7 @@ const CartContents = () => {
item.key,
data.cart.contents.nodes,
updateCart,
updateCartProcessing
updateCartProcessing,
);
}}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Checkout/CheckoutForm.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const CheckoutForm = () => {
setRequestError(error);
refetch();
},
}
},
);

useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Product/DisplayProducts.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const DisplayProducts = ({ products }: IDisplayProductsProps) => (
>
<Link
href={`/produkt/${encodeURIComponent(
slug
slug,
)}?id=${encodeURIComponent(databaseId)}`}
>
<span>
Expand All @@ -106,7 +106,7 @@ const DisplayProducts = ({ products }: IDisplayProductsProps) => (

<Link
href={`/produkt/${encodeURIComponent(
slug
slug,
)}?id=${encodeURIComponent(databaseId)}`}
>
<span>
Expand Down Expand Up @@ -136,7 +136,7 @@ const DisplayProducts = ({ products }: IDisplayProductsProps) => (
)}
</div>
);
}
},
)
) : (
<div className="mx-auto text-xl font-bold text-center text-gray-800 no-underline uppercase">
Expand Down
4 changes: 2 additions & 2 deletions src/components/Product/SingleProduct.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const SingleProduct = ({ product }: IProductRootObject) => {
if (process.browser) {
DESCRIPTION_WITHOUT_HTML = new DOMParser().parseFromString(
description,
'text/html'
'text/html',
).body.textContent;
}

Expand Down Expand Up @@ -129,7 +129,7 @@ const SingleProduct = ({ product }: IProductRootObject) => {
{filteredName} - ({stockQuantity} på lager)
</option>
);
}
},
)}
</select>
</p>
Expand Down
6 changes: 3 additions & 3 deletions src/tests/Produkter/Produkter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test.describe('Produkter', () => {

// Check that that Handlekurv is visible
await expect(
page.locator('section').filter({ hasText: 'Handlekurv' })
page.locator('section').filter({ hasText: 'Handlekurv' }),
).toBeVisible();

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

await expect(
page.locator('section').filter({ hasText: 'Kasse' })
page.locator('section').filter({ hasText: 'Kasse' }),
).toBeVisible();

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

await expect(page.getByPlaceholder('Etternavn')).toHaveValue(
'testetternavn'
'testetternavn',
);
});
});
6 changes: 3 additions & 3 deletions src/utils/apollo/ApolloClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const afterware = new ApolloLink((operation, forward) =>
}

return response;
})
}),
);

const clientSide = typeof window === 'undefined';
Expand All @@ -69,8 +69,8 @@ const client = new ApolloClient({
createHttpLink({
uri: process.env.NEXT_PUBLIC_GRAPHQL_URL,
fetch,
})
)
}),
),
),
cache: new InMemoryCache(),
});
Expand Down
6 changes: 3 additions & 3 deletions src/utils/functions/functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export const getFormattedCart = (data: IFormattedCartProps) => {
// Convert price to a float value
const convertedCurrency = givenProducts[Number(i)].total.replace(
/[^0-9.-]+/g,
''
'',
);

product.productId = givenProduct.productId;
Expand Down Expand Up @@ -253,7 +253,7 @@ export const createCheckoutData = (order: ICheckoutDataProps) => ({
export const getUpdatedItems = (
products: IProductRootObject[],
newQty: number,
cartKey: string
cartKey: string,
) => {
// Create an empty array.

Expand Down Expand Up @@ -290,7 +290,7 @@ export const handleQuantityChange = (
cartKey: string,
cart: IProductRootObject[],
updateCart: (variables: IUpdateCartRootObject) => void,
updateCartProcessing: boolean
updateCartProcessing: boolean,
) => {
if (process.browser) {
event.stopPropagation();
Expand Down

1 comment on commit 82ea8f1

@vercel
Copy link

@vercel vercel bot commented on 82ea8f1 Jul 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.