Skip to content

Commit 6f6ca9d

Browse files
committed
Prettier
1 parent ee6a728 commit 6f6ca9d

21 files changed

+174
-174
lines changed

app.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414

1515
<script setup>
1616
useHead({
17-
title: 'Index',
18-
titleTemplate: '%s - Nuxt 3 Woocommerce',
17+
title: "Index",
18+
titleTemplate: "%s - Nuxt 3 Woocommerce",
1919
meta: [
20-
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
20+
{ name: "viewport", content: "width=device-width, initial-scale=1" },
2121
{
22-
hid: 'description',
23-
name: 'description',
24-
content: 'Nuxt 3 Woocommerce',
22+
hid: "description",
23+
name: "description",
24+
content: "Nuxt 3 Woocommerce",
2525
},
2626
],
27-
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
28-
})
27+
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
28+
});
2929
</script>
3030

3131
<style>

components/Cart/CartAddToCartButton.vue

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,44 +27,44 @@
2727
</template>
2828

2929
<script setup>
30-
import ADD_TO_CART_MUTATION from '@/apollo/mutations/ADD_TO_CART_MUTATION.gql'
30+
import ADD_TO_CART_MUTATION from "@/apollo/mutations/ADD_TO_CART_MUTATION.gql";
3131
32-
const isLoading = useState('isLoading', () => false)
33-
const isError = useState('isError', () => false)
32+
const isLoading = useState("isLoading", () => false);
33+
const isError = useState("isError", () => false);
3434
3535
defineProps({
3636
product: {
3737
type: [Object],
3838
required: true,
3939
},
40-
})
40+
});
4141
4242
const addProductToCart = (product) => {
43-
const productId = product.databaseId ? product.databaseId : product
43+
const productId = product.databaseId ? product.databaseId : product;
4444
const productQueryInput = {
4545
productId,
46-
}
46+
};
4747
48-
const variables = { input: productQueryInput }
48+
const variables = { input: productQueryInput };
4949
5050
const { mutate, onDone, onError } = useMutation(ADD_TO_CART_MUTATION, {
5151
variables,
52-
})
52+
});
5353
54-
isLoading.value = true
54+
isLoading.value = true;
5555
56-
mutate(variables)
56+
mutate(variables);
5757
5858
onDone(() => {
59-
isLoading.value = false
60-
isError.value = false
61-
})
59+
isLoading.value = false;
60+
isError.value = false;
61+
});
6262
6363
onError(() => {
64-
isLoading.value = false
65-
isError.value = true
66-
})
67-
}
64+
isLoading.value = false;
65+
isError.value = true;
66+
});
67+
};
6868
</script>
6969

7070
<style scoped>

components/Cart/CartContents.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,46 +52,46 @@
5252
</template>
5353

5454
<script setup>
55-
import GET_CART_QUERY from '@/apollo/queries/GET_CART_QUERY.gql'
56-
import UPDATE_CART_MUTATION from '@/apollo/mutations/UPDATE_CART_MUTATION.gql'
55+
import GET_CART_QUERY from "@/apollo/queries/GET_CART_QUERY.gql";
56+
import UPDATE_CART_MUTATION from "@/apollo/mutations/UPDATE_CART_MUTATION.gql";
5757
58-
const isRemoving = useState('isRemoving', () => false)
58+
const isRemoving = useState("isRemoving", () => false);
5959
6060
defineProps({
6161
showCheckoutButton: { type: Boolean, required: false, default: false },
62-
})
62+
});
6363
64-
const { data } = await useAsyncQuery(GET_CART_QUERY)
64+
const { data } = await useAsyncQuery(GET_CART_QUERY);
6565
6666
const handleRemoveProduct = ({ key }) => {
67-
const updatedItems = []
67+
const updatedItems = [];
6868
6969
updatedItems.push({
7070
key,
7171
quantity: 0,
72-
})
72+
});
7373
74-
isRemoving.value = true
74+
isRemoving.value = true;
7575
7676
const variables = {
7777
input: {
7878
items: updatedItems,
7979
},
80-
}
80+
};
8181
8282
const { mutate, onDone, onError } = useMutation(UPDATE_CART_MUTATION, {
8383
variables,
84-
})
84+
});
8585
86-
mutate(variables)
86+
mutate(variables);
8787
8888
onDone(() => {
89-
isRemoving.value = false
90-
document.location = '/cart'
91-
})
89+
isRemoving.value = false;
90+
document.location = "/cart";
91+
});
9292
93-
onError(() => (isRemoving.value = false))
94-
}
93+
onError(() => (isRemoving.value = false));
94+
};
9595
</script>
9696

9797
<style scoped>

components/Category/CategoryShowAll.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ defineProps({
3838
type: [Object],
3939
required: true,
4040
},
41-
})
41+
});
4242
</script>

components/Category/CategoryShowProducts.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const props = defineProps({
2424
type: [Object],
2525
required: true,
2626
},
27-
})
27+
});
2828
29-
const noProducts = computed(() => props.products.products.nodes.length === 0)
29+
const noProducts = computed(() => props.products.products.nodes.length === 0);
3030
</script>

components/Checkout/CheckoutButton.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
defineProps({
3131
loading: { type: Boolean, required: false, default: false },
3232
success: { type: Boolean, required: false, default: false },
33-
})
33+
});
3434
</script>

components/Checkout/CheckoutForm.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@
3434
</template>
3535

3636
<script setup>
37-
import { Form, Field, ErrorMessage } from 'vee-validate'
38-
import { uid } from 'uid'
37+
import { Form, Field, ErrorMessage } from "vee-validate";
38+
import { uid } from "uid";
3939
40-
import { BILLING_FIELDS, BILLING_SCHEMA } from './constants/BILLING_FIELDS'
40+
import { BILLING_FIELDS, BILLING_SCHEMA } from "./constants/BILLING_FIELDS";
4141
42-
import CHECKOUT_MUTATION from '@/apollo/mutations/CHECKOUT_MUTATION.gql'
42+
import CHECKOUT_MUTATION from "@/apollo/mutations/CHECKOUT_MUTATION.gql";
4343
4444
const upperCaseFirstChar = (input) =>
45-
input.charAt(0).toUpperCase() + input.slice(1)
45+
input.charAt(0).toUpperCase() + input.slice(1);
4646
47-
const paymentMethod = 'cod'
47+
const paymentMethod = "cod";
4848
4949
const handleSubmit = ({
5050
firstName,
@@ -71,7 +71,7 @@ const handleSubmit = ({
7171
email,
7272
phone,
7373
company,
74-
}
74+
};
7575
7676
const checkoutData = {
7777
clientMutationId: uid(),
@@ -80,19 +80,19 @@ const handleSubmit = ({
8080
shipToDifferentAddress: false,
8181
paymentMethod,
8282
isPaid: false,
83-
transactionId: 'hjkhjkhsdsdiui',
84-
}
83+
transactionId: "hjkhjkhsdsdiui",
84+
};
8585
86-
const variables = { input: checkoutData }
86+
const variables = { input: checkoutData };
8787
8888
const { mutate, onDone, onError } = useMutation(CHECKOUT_MUTATION, {
8989
variables,
90-
})
90+
});
9191
92-
mutate(checkoutData)
92+
mutate(checkoutData);
9393
94-
onDone(() => alert('Order placed!'))
94+
onDone(() => alert("Order placed!"));
9595
96-
onError(() => alert('Error, order not placed'))
97-
}
96+
onError(() => alert("Error, order not placed"));
97+
};
9898
</script>

components/Layout/LayoutCart.vue

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,37 @@
3535
</template>
3636

3737
<script setup>
38-
import GET_CART_QUERY from '@/apollo/queries/GET_CART_QUERY.gql'
38+
import GET_CART_QUERY from "@/apollo/queries/GET_CART_QUERY.gql";
3939
40-
import { getCookie } from '@/utils/functions'
40+
import { getCookie } from "@/utils/functions";
4141
42-
const cartLength = useState('cartLength', () => 0)
43-
const subTotal = useState('subTotal', '')
44-
const remoteError = useState('remoteError', () => false)
42+
const cartLength = useState("cartLength", () => 0);
43+
const subTotal = useState("subTotal", "");
44+
const remoteError = useState("remoteError", () => false);
4545
4646
const { data, error, pending, execute } = await useAsyncQuery(GET_CART_QUERY, {
47-
options: { fetchPolicy: 'cache-and-network' },
48-
})
47+
options: { fetchPolicy: "cache-and-network" },
48+
});
4949
5050
const updateCartDisplay = () => {
5151
if (!data) {
52-
return
52+
return;
5353
}
5454
5555
cartLength.value = data.value.cart.contents.nodes.reduce(
5656
(accumulator, argument) => accumulator + argument.quantity,
5757
0
58-
)
58+
);
5959
60-
subTotal.value = data.value.cart.total
60+
subTotal.value = data.value.cart.total;
6161
62-
remoteError.value = error
63-
}
62+
remoteError.value = error;
63+
};
6464
6565
setInterval(() => {
66-
if (process.client && !pending.value && getCookie('woo-session')) {
67-
execute()
68-
updateCartDisplay()
66+
if (process.client && !pending.value && getCookie("woo-session")) {
67+
execute();
68+
updateCartDisplay();
6969
}
70-
}, 3000)
70+
}, 3000);
7171
</script>

components/Layout/LayoutFooter.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</template>
1212

1313
<script setup>
14-
import { computed } from 'vue'
14+
import { computed } from "vue";
1515
16-
const todayDate = computed(() => new Date().getFullYear())
16+
const todayDate = computed(() => new Date().getFullYear());
1717
</script>

components/Layout/LayoutMobileMenu.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@
5353
</template>
5454

5555
<script setup>
56-
const expandedMenu = useState('expandedMenu', () => false)
57-
const firstRender = useState('firstRender', () => true)
56+
const expandedMenu = useState("expandedMenu", () => false);
57+
const firstRender = useState("firstRender", () => true);
5858
5959
const displayMobileMenu = () => {
60-
expandedMenu.value = !expandedMenu.value
61-
firstRender.value = false
62-
}
60+
expandedMenu.value = !expandedMenu.value;
61+
firstRender.value = false;
62+
};
6363
</script>
6464

6565
<style scoped>
@@ -91,7 +91,7 @@ const displayMobileMenu = () => {
9191
top: 1em;
9292
}
9393
.burger:after {
94-
content: '';
94+
content: "";
9595
display: block;
9696
position: absolute;
9797
height: 150%;
@@ -108,7 +108,7 @@ const displayMobileMenu = () => {
108108
.burger .burger-lines:before {
109109
pointer-events: none;
110110
display: block;
111-
content: '';
111+
content: "";
112112
width: 100%;
113113
border-radius: 0.25em;
114114
background-color: #000;

0 commit comments

Comments
 (0)