Skip to content

Commit 388cb7a

Browse files
committed
feat: add devtools
1 parent 1886e73 commit 388cb7a

File tree

6 files changed

+3153
-206
lines changed

6 files changed

+3153
-206
lines changed

app.vue

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,9 @@
11
<template>
2-
<div class="mx-auto box-content w-full max-w-[935px] grow p-1">
3-
<div role="tablist" class="my-4 flex max-w-full flex-col items-stretch">
4-
<div class="flex flex-row flex-nowrap items-center gap-4">
5-
<Logo />
6-
<ProductSearchBox :searchTerm="searchTerm" :selectedCategory="selectedCategory" :loading="loading" v-model:searchTerm="searchTerm" />
7-
<ButtonSelectCategory @click.stop="toggleDropdown('category')" :show="isDropdownCategory" :categories="categories" v-model:selectedCategory="selectedCategory" />
8-
<ButtonSortBy @click.stop="toggleDropdown('sortBy')" :show="isDropdownSortBy" :options="options" v-model:selectedOption="selectedOption" />
9-
</div>
10-
</div>
11-
<div class="grid grid-cols-3 gap-4">
12-
<ProductCard v-for="product in products" :key="product.id" :product="product" />
13-
<ProductSkeleton v-if="loading" />
14-
</div>
15-
<ProductEmpty v-if="!empty" :selectedCategory="selectedCategory" :searchTerm="searchTerm" />
16-
<AppFooter />
17-
</div>
2+
<NuxtLayout>
3+
<NuxtPage />
4+
</NuxtLayout>
185
</template>
196

20-
<script setup>
21-
const { products, empty, loading, categories, options, searchTerm, selectedCategory, selectedOption, isDropdownCategory, isDropdownSortBy } = useSearch();
22-
23-
const toggleDropdown = (type) => {
24-
if (type === 'category') {
25-
isDropdownCategory.value = !isDropdownCategory.value;
26-
isDropdownSortBy.value = false;
27-
} else if (type === 'sortBy') {
28-
isDropdownSortBy.value = !isDropdownSortBy.value;
29-
isDropdownCategory.value = false;
30-
}
31-
};
32-
</script>
33-
347
<style lang="postcss">
358
.dark {
369
@apply bg-black text-neutral-100;

layouts/default.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div class="mx-auto box-content w-full max-w-[935px] grow p-1">
3+
<slot />
4+
</div>
5+
</template>

nuxt.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,25 @@ import pkg from './package.json';
22

33
export default defineNuxtConfig({
44
modules: ['@nuxt/image-edge', '@nuxtjs/tailwindcss', '@nuxtjs/color-mode', '@nuxtjs/apollo', 'nuxt-icon'],
5+
56
runtimeConfig: {
67
public: {
78
version: pkg.version,
89
},
910
},
11+
1012
colorMode: {
1113
classSuffix: '',
1214
},
15+
1316
apollo: {
1417
clients: {
1518
default: {
1619
httpEndpoint: process.env.GQL_HOST,
1720
},
1821
},
1922
},
23+
2024
app: {
2125
head: {
2226
link: [
@@ -26,4 +30,6 @@ export default defineNuxtConfig({
2630
],
2731
},
2832
},
33+
34+
devtools: true
2935
});

0 commit comments

Comments
 (0)