Skip to content

Commit ee770b4

Browse files
committed
Prettier
1 parent 120a7e2 commit ee770b4

27 files changed

+104555
-79699
lines changed

package-lock.json

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

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"hot": "mix watch --hot",
1010
"prod": "npm run production",
1111
"production": "mix --production",
12-
"test": "jest"
12+
"test": "jest",
13+
"format": "prettier --write \"**/*.{js,vue,json}\"",
14+
"refresh": "rm -rf node_modules && rm package-lock.json && npm i && npm run format"
1315
},
1416
"devDependencies": {
1517
"@babel/preset-env": "7.22.2",
@@ -28,7 +30,8 @@
2830
"lodash": "4.17.21",
2931
"postcss": "8.4.23",
3032
"tailwindcss": "3.3.2",
31-
"vue-loader": "17.1.1"
33+
"vue-loader": "17.1.1",
34+
"prettier": "2.8.8"
3235
},
3336
"dependencies": {
3437
"@formkit/addons": "1.0.0-beta.9-f64c966",

public/js/app.js

Lines changed: 97582 additions & 71653 deletions
Large diffs are not rendered by default.

renovate.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"extends": [
3-
"config:base"
4-
]
2+
"extends": ["config:base"]
53
}

resources/js/bootstrap.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
window._ = require('lodash');
1+
window._ = require("lodash");
22

33
/**
44
* We'll load the axios HTTP library which allows us to easily issue requests
55
* to our Laravel back-end. This library automatically handles sending the
66
* CSRF token as a header based on the value of the "XSRF" token cookie.
77
*/
88

9-
window.axios = require('axios');
9+
window.axios = require("axios");
1010

11-
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
11+
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
1212

1313
/**
1414
* Echo exposes an expressive API for subscribing to channels and listening
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<template>
2-
<div>Show all categories</div>
2+
<div>Show all categories</div>
33
</template>
44

5-
<script setup>
6-
7-
</script>
5+
<script setup></script>
Lines changed: 84 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,82 @@
11
<template>
2-
<div class="w-full">
3-
<h3 class="h-12 py-4 mt-2 text-2xl font-bold text-center">Cart summary</h3>
4-
</div>
2+
<div class="w-full">
3+
<h3 class="h-12 py-4 mt-2 text-2xl font-bold text-center">
4+
Cart summary
5+
</h3>
6+
</div>
57

6-
<div class="relative mt-2 overflow-x-auto">
7-
<table
8-
class="w-full flex flex-row flex-no-wrap sm:bg-white rounded-lg overflow-hidden sm:shadow-lg my-5"
9-
>
10-
<caption class="sr-only">
11-
Cart summary
12-
</caption>
13-
<thead class="text-white">
14-
<template v-for="_content in getCartContent" :key="content">
15-
<tr
16-
class="bg-gray-600 flex flex-col flex-no wrap sm:table-row rounded-l-lg sm:rounded-none mb-2 sm:mb-0"
17-
>
18-
<th
19-
v-for="header in tableHeaders"
20-
:key="header"
21-
scope="col"
22-
class="p-3 text-center h-12"
23-
>
24-
{{ header }}
25-
</th>
26-
</tr>
27-
</template>
28-
</thead>
29-
<tbody class="flex-1 sm:flex-none">
30-
<template
31-
v-for="{ id, name, quantity, price } in getCartContent"
32-
:key="id"
33-
class="border-grey-light border hover:bg-gray-100 p-3 text-center"
8+
<div class="relative mt-2 overflow-x-auto">
9+
<table
10+
class="w-full flex flex-row flex-no-wrap sm:bg-white rounded-lg overflow-hidden sm:shadow-lg my-5"
3411
>
35-
<tr class="flex flex-col flex-no wrap sm:table-row mb-2 sm:mb-0">
36-
<td class="border-grey-light border hover:bg-gray-100 h-12">
37-
<a tabindex="0" @click="removeProductFromCart(id)">
38-
<img
39-
class="mt-2 mx-auto cursor-pointer"
40-
alt="Remove icon"
41-
aria-label="Remove"
42-
src="../../../img/svg/Remove.svg"
43-
/>
44-
</a>
45-
</td>
46-
<td class="border-grey-light border hover:bg-gray-100 p-3 text-center h-12">
47-
{{ name }}
48-
</td>
49-
<td class="border-grey-light border hover:bg-gray-100 p-3 text-center h-12">
50-
{{ quantity }}
51-
</td>
52-
<td class="border-grey-light border hover:bg-gray-100 p-3 text-center h-12">
53-
{{ formatPrice(price) }}
54-
</td>
55-
</tr>
56-
</template>
57-
</tbody>
58-
</table>
59-
<div
60-
v-if="getCartQuantity"
61-
class="container mx-auto flex flex-wrap flex-row justify-end items-end content-center"
62-
>
63-
<span class="p-4 text-xl font-bold text-right"
64-
>Total: {{ formatPrice(getCartTotal) }}</span
65-
>
12+
<caption class="sr-only">
13+
Cart summary
14+
</caption>
15+
<thead class="text-white">
16+
<template v-for="_content in getCartContent" :key="content">
17+
<tr
18+
class="bg-gray-600 flex flex-col flex-no wrap sm:table-row rounded-l-lg sm:rounded-none mb-2 sm:mb-0"
19+
>
20+
<th
21+
v-for="header in tableHeaders"
22+
:key="header"
23+
scope="col"
24+
class="p-3 text-center h-12"
25+
>
26+
{{ header }}
27+
</th>
28+
</tr>
29+
</template>
30+
</thead>
31+
<tbody class="flex-1 sm:flex-none">
32+
<template
33+
v-for="{ id, name, quantity, price } in getCartContent"
34+
:key="id"
35+
class="border-grey-light border hover:bg-gray-100 p-3 text-center"
36+
>
37+
<tr
38+
class="flex flex-col flex-no wrap sm:table-row mb-2 sm:mb-0"
39+
>
40+
<td
41+
class="border-grey-light border hover:bg-gray-100 h-12"
42+
>
43+
<a tabindex="0" @click="removeProductFromCart(id)">
44+
<img
45+
class="mt-2 mx-auto cursor-pointer"
46+
alt="Remove icon"
47+
aria-label="Remove"
48+
src="../../../img/svg/Remove.svg"
49+
/>
50+
</a>
51+
</td>
52+
<td
53+
class="border-grey-light border hover:bg-gray-100 p-3 text-center h-12"
54+
>
55+
{{ name }}
56+
</td>
57+
<td
58+
class="border-grey-light border hover:bg-gray-100 p-3 text-center h-12"
59+
>
60+
{{ quantity }}
61+
</td>
62+
<td
63+
class="border-grey-light border hover:bg-gray-100 p-3 text-center h-12"
64+
>
65+
{{ formatPrice(price) }}
66+
</td>
67+
</tr>
68+
</template>
69+
</tbody>
70+
</table>
71+
<div
72+
v-if="getCartQuantity"
73+
class="container mx-auto flex flex-wrap flex-row justify-end items-end content-center"
74+
>
75+
<span class="p-4 text-xl font-bold text-right"
76+
>Total: {{ formatPrice(getCartTotal) }}</span
77+
>
78+
</div>
6679
</div>
67-
</div>
6880
</template>
6981

7082
<script setup>
@@ -80,26 +92,26 @@ const store = useCart();
8092
const { getCartContent, getCartTotal, getCartQuantity } = storeToRefs(store);
8193
8294
const removeProductFromCart = (id) => {
83-
store.removeProductFromCart(id);
95+
store.removeProductFromCart(id);
8496
};
8597
</script>
8698

8799
<style>
88100
@media (min-width: 640px) {
89-
table {
90-
display: inline-table !important;
91-
}
101+
table {
102+
display: inline-table !important;
103+
}
92104
93-
thead tr:not(:first-child) {
94-
display: none;
95-
}
105+
thead tr:not(:first-child) {
106+
display: none;
107+
}
96108
}
97109
98110
td:not(:last-child) {
99-
border-bottom: 0;
111+
border-bottom: 0;
100112
}
101113
102114
th:not(:last-child) {
103-
border-bottom: 2px solid rgba(0, 0, 0, 0.1);
115+
border-bottom: 2px solid rgba(0, 0, 0, 0.1);
104116
}
105117
</style>
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<template>
2-
<base-table
3-
tableTitle="Customer details"
4-
:tableHeaders="['Name', 'Address', 'Zipcode', 'City', 'State', 'Email']"
5-
:tableData="[`${firstName} ${lastName}`, address, zipcode, city, state, email]"
6-
/>
2+
<base-table
3+
tableTitle="Customer details"
4+
:tableHeaders="['Name', 'Address', 'Zipcode', 'City', 'State', 'Email']"
5+
:tableData="[
6+
`${firstName} ${lastName}`,
7+
address,
8+
zipcode,
9+
city,
10+
state,
11+
email,
12+
]"
13+
/>
714
</template>
815

916
<script setup>
1017
import { useCart } from "../../store/useCart";
1118
1219
const store = useCart();
1320
14-
const {
15-
firstName,
16-
lastName,
17-
address,
18-
zipcode,
19-
city,
20-
state,
21-
email,
22-
} = store.getCustomerDetails;
21+
const { firstName, lastName, address, zipcode, city, state, email } =
22+
store.getCustomerDetails;
2323
</script>
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<template>
2-
<base-table
3-
tableTitle="Card details for testing"
4-
:tableHeaders="['Number', 'CVC', 'Date', 'Zipcode']"
5-
:tableData="['4242424242424242', 'Any 3 digits', 'Any future date', 'Any zip code']"
6-
/>
2+
<base-table
3+
tableTitle="Card details for testing"
4+
:tableHeaders="['Number', 'CVC', 'Date', 'Zipcode']"
5+
:tableData="[
6+
'4242424242424242',
7+
'Any 3 digits',
8+
'Any future date',
9+
'Any zip code',
10+
]"
11+
/>
712
</template>

0 commit comments

Comments
 (0)