Skip to content

Commit

Permalink
chore: clean up of codebase ⚡️
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
  • Loading branch information
vinayakkulkarni committed Jul 28, 2023
1 parent 0831f3e commit 8d9e89f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 41 deletions.
19 changes: 5 additions & 14 deletions components/common/ui/VFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,11 @@
</div>
</template>

<script lang="ts">
<script setup lang="ts">
import { useNuxtApp } from '#app';
import { defineComponent, reactive } from 'vue';
export default defineComponent({
name: 'VFooter',
setup() {
const { $config } = useNuxtApp();
const state = reactive({
date: new Date().getFullYear(),
appVersion: $config.public.appVersion,
});
return {
state,
};
},
const { $config } = useNuxtApp();
const state = reactive({
date: new Date().getFullYear(),
appVersion: $config.public.appVersion,
});
</script>
30 changes: 9 additions & 21 deletions components/common/ui/VHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
data-name="Layer 1"
viewBox="0 0 512 512"
:class="[isDark ? 'text-white' : 'text-gray-900']"
@click="$router.push({ name: 'index' })"
@click="router.push({ name: 'index' })"
>
<defs />
<path
Expand All @@ -26,10 +26,11 @@
<div class="flex items-center space-x-2">
<div class="text-sm">
<span>
{{ map.zoom.toFixed(2) }}
{{ map.map.state.zoom.toFixed(2) }}
</span>
<span class="opacity-75">
[{{ map.latitude.toFixed(2) }}, {{ map.longitude.toFixed(2) }}]
[{{ map.map.state.latitude.toFixed(2) }},
{{ map.map.state.longitude.toFixed(2) }}]
</span>
</div>
<div tile="Theme Picker" class="visible">
Expand Down Expand Up @@ -62,23 +63,10 @@
</div>
</template>

<script lang="ts">
import { useDark, useToggle } from '@vueuse/core';
import { useMap } from '~/composables/useMap';
<script setup lang="ts">
const isDark = useDark();
const toggleDark = useToggle(isDark);
export default defineComponent({
name: 'VHeader',
setup() {
const isDark = useDark();
const map = useMap();
const toggleDark = useToggle(isDark);
return {
isDark,
map: map.$state.map.state,
toggleDark,
};
},
});
const router = useRouter();
const map = useMap();
</script>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions lib/v-mapbox/markers/VMarker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
<section :id="`marker-${Date.now()}`" class="absolute">
<slot :set-ref="setSlotRef" name="markers" />
<template v-if="isMarkerAvailable">
<v-popup
<VPopup
:marker="marker"
:options="popupOptions"
:coordinates="coordinates"
>
<slot />
</v-popup>
</VPopup>
</template>
</section>
</template>
<script lang="ts">
import type { LngLatLike, MarkerOptions, PopupOptions } from 'maplibre-gl';
import { Marker } from 'maplibre-gl';
import type { PropType, Ref } from 'vue';
import { Marker } from 'maplibre-gl';
import { defineComponent, onMounted, onBeforeUnmount, ref, watch } from 'vue';
import { markerDOMEvents, markerMapEvents } from '../constants/events';
import VPopup from '../popups/VPopup.vue';
Expand All @@ -34,12 +34,12 @@
},
options: {
type: Object as PropType<MarkerOptions>,
default: () => ({} as MarkerOptions),
default: () => ({}) as MarkerOptions,
required: false,
},
popupOptions: {
type: Object as PropType<PopupOptions>,
default: () => ({} as PopupOptions),
default: () => ({}) as PopupOptions,
required: false,
},
cursor: {
Expand Down
2 changes: 1 addition & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
v-if="mapStore.$state.utils.upload.shown"
class="absolute right-0 top-0 mr-12 w-64 origin-right rounded-md bg-gray-300 shadow-lg ring-1 ring-white ring-opacity-5 dark:bg-gray-700"
>
<expense-upload
<ExpenseUpload
@data="onWorkerData"
@close="mapStore.$state.utils.upload.shown = false"
/>
Expand Down

0 comments on commit 8d9e89f

Please sign in to comment.