Skip to content

Commit a76f040

Browse files
committed
chore(template): cleanup
Signed-off-by: Frederik Bußmann <frederik@bussmann.io>
1 parent e114711 commit a76f040

6 files changed

Lines changed: 16 additions & 29 deletions

File tree

template/app/components/cart/Modal.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<script setup lang="ts">
22
const { open, loading, quantity, lines, total, checkoutUrl } = useCart()
33
const route = useRoute()
4-
const { t } = useI18n()
54
65
watch(() => route.path, () => open.value = false)
76
</script>
87

98
<template>
109
<USlideover
1110
v-model:open="open"
12-
:title="t('cart.title')"
13-
:description="t('cart.description')"
11+
:title="$t('cart.title')"
12+
:description="$t('cart.description')"
1413
:ui="{ description: 'sr-only', body: 'flex flex-col gap-y-6' }"
1514
>
1615
<div class="relative">
@@ -50,7 +49,7 @@ watch(() => route.path, () => open.value = false)
5049
v-if="lines.length === 0"
5150
class="my-auto text-center"
5251
>
53-
{{ t('cart.empty') }}
52+
{{ $t('cart.empty') }}
5453
</p>
5554
</template>
5655

@@ -64,7 +63,7 @@ watch(() => route.path, () => open.value = false)
6463
>
6564
<div class="flex items-center gap-2">
6665
<p class="font-medium inline-block">
67-
{{ t('cart.subtotal') }}:
66+
{{ $t('cart.subtotal') }}:
6867
<ProductPrice :price="total" />
6968
</p>
7069

@@ -79,7 +78,7 @@ watch(() => route.path, () => open.value = false)
7978
variant="ghost"
8079
color="neutral"
8180
:to="checkoutUrl"
82-
:label="t('cart.checkout')"
81+
:label="$t('cart.checkout')"
8382
size="xl"
8483
trailing-icon="i-lucide-arrow-right"
8584
:ui="{

template/app/components/filter/type/PriceRange.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const props = defineProps<{
1010
}>()
1111
1212
const { get, set } = useFilters('price')
13-
const { t } = useI18n()
1413
1514
const input = computed(() => JSON.parse(props.filter.values.at(0)?.input ?? '{}')?.price as FilterValue)
1615
@@ -39,7 +38,7 @@ const submit = async (value: FilterValue) => set(componentToFilter(value))
3938
<div class="flex flex-row gap-4">
4039
<UFormField
4140
name="min"
42-
:label="t('price.from')"
41+
:label="$t('price.from')"
4342
>
4443
<UInputNumber
4544
v-model="state.min"
@@ -52,7 +51,7 @@ const submit = async (value: FilterValue) => set(componentToFilter(value))
5251

5352
<UFormField
5453
name="max"
55-
:label="t('price.to')"
54+
:label="$t('price.to')"
5655
>
5756
<UInputNumber
5857
v-model="state.max"

template/app/components/search/Modal.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
const { language, country } = useLocalization()
33
const localePath = useLocalePath()
4-
const { t, locale } = useI18n()
4+
const { locale } = useI18n()
55
66
const query = ref('')
77
const open = ref(false)
@@ -62,15 +62,15 @@ const { data, status } = await useStorefrontData(`search-${query.value ?? 'none'
6262
const groups = computed(() => [
6363
{
6464
id: 'queries',
65-
label: t('search.queries'),
65+
label: $t('search.queries'),
6666
items: data.value?.predictiveSearch?.queries.map(predictedQuery => ({
6767
label: predictedQuery.text,
6868
onSelect: () => query.value = predictedQuery.text,
6969
})),
7070
},
7171
{
7272
id: 'products',
73-
label: t('search.products'),
73+
label: $t('search.products'),
7474
items: flattenConnection(data.value?.products).map(product => ({
7575
label: product.title,
7676
suffix: product.description,
@@ -84,7 +84,7 @@ const groups = computed(() => [
8484
},
8585
{
8686
id: 'collections',
87-
label: t('search.collections'),
87+
label: $t('search.collections'),
8888
items: flattenConnection(data.value?.collections).map(collection => ({
8989
label: collection.title,
9090
suffix: collection.description,
@@ -94,7 +94,7 @@ const groups = computed(() => [
9494
},
9595
{
9696
id: 'articles',
97-
label: t('search.articles'),
97+
label: $t('search.articles'),
9898
items: flattenConnection(data.value?.articles).map(article => ({
9999
label: article.title,
100100
suffix: article.excerpt ?? undefined,
@@ -110,20 +110,20 @@ const updateQuery = debounce((value: string) => query.value = value, 300)
110110
<template>
111111
<UModal
112112
v-model:open="open"
113-
:title="t('search.label')"
114-
:description="t('search.description')"
113+
:title="$t('search.label')"
114+
:description="$t('search.description')"
115115
>
116116
<UButton
117117
icon="i-lucide-search"
118118
variant="ghost"
119119
color="neutral"
120-
:label="t('search.label')"
120+
:label="$t('search.label')"
121121
/>
122122

123123
<template #content>
124124
<UCommandPalette
125125
:loading="status === 'pending'"
126-
:placeholder="t('search.placeholder')"
126+
:placeholder="$t('search.placeholder')"
127127
:groups="groups"
128128
:close="true"
129129
@update:search-term="updateQuery"

template/app/composables/product.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

template/app/utils/query.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,3 @@ export const filtersToQuery = (filters: ProductFilter[]) => {
4242

4343
return query
4444
}
45-
46-
export const queryToVariantId = (query: LocationQuery) => typeof query.variantId === 'string'
47-
? `gid://shopify/ProductVariant/${query.variantId}`
48-
: undefined
49-
50-
export const variantIdToQuery = (variantId?: string): LocationQuery => variantId
51-
? { variantId: variantId.replace('gid://shopify/ProductVariant/', '') }
52-
: {}

template/nuxt.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export default defineNuxtConfig({
1818
vite: {
1919
server: {
2020
allowedHosts: [
21-
'.ngrok-free.app',
2221
'.vercel.app',
2322
],
2423
},

0 commit comments

Comments
 (0)