Skip to content

Commit

Permalink
chore: remove unused props #447
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab committed Dec 18, 2024
1 parent 35ed322 commit b58887d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
16 changes: 7 additions & 9 deletions components/PoisDetails/PoiDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ import IconButton from '~/components/UI/IconButton.vue'
import RelativeDate from '~/components/UI/RelativeDate.vue'
import TeritorioIcon from '~/components/UI/TeritorioIcon.vue'
import TeritorioIconBadge from '~/components/UI/TeritorioIconBadge.vue'
import type { ContentEntry } from '~/lib/apiContent'
import type { ApiPoiDeps } from '~/lib/apiPoiDeps'
import type { ApiPoi, FieldsList } from '~/lib/apiPois'
import type { Settings } from '~/lib/apiSettings'
import { favoriteStore as useFavoriteStore } from '~/stores/favorite'
import { siteStore as useSiteStore } from '~/stores/site'
import { OriginEnum } from '~/utils/types'
import FieldsHeader from '~/components/UI/FieldsHeader.vue'
import ContribFieldGroup from '~/components/Fields/ContribFieldGroup.vue'
Expand All @@ -26,8 +25,6 @@ import Footer from '~/components/Layout/Footer.vue'
// Props
//
const props = defineProps<{
settings: Settings
navMenuEntries: ContentEntry[]
poi: ApiPoi
poiDeps?: ApiPoiDeps
pageTitle: string
Expand All @@ -40,6 +37,7 @@ const router = useRouter()
const route = useRoute()
const { $tracking } = useNuxtApp()
const { t } = useI18n()
const { settings, contents } = storeToRefs(useSiteStore())
const { contribMode, isContribEligible, getContributorFields } = useContrib()
const favoriteStore = useFavoriteStore()
const { favoritesIds, favoriteAddresses } = storeToRefs(favoriteStore)
Expand All @@ -48,7 +46,7 @@ const { favoritesIds, favoriteAddresses } = storeToRefs(favoriteStore)
// Computed
//
const favoritesModeEnabled = computed(() => {
return props.settings.themes[0]?.favorites_mode ?? true
return settings.value?.themes[0]?.favorites_mode ?? true
})
const isLargeLayeout = computed(() => {
Expand Down Expand Up @@ -151,8 +149,8 @@ function back() {
<template>
<VContainer>
<Header
:theme="settings.themes[0]"
:nav-menu-entries="navMenuEntries"
:theme="settings?.themes[0]"
:nav-menu-entries="contents!"
:color-line="colorLine"
>
<IconButton
Expand Down Expand Up @@ -219,7 +217,7 @@ function back() {

<template v-if="!isLargeLayeout">
<MapPois
:extra-attributions="settings.attributions"
:extra-attributions="settings?.attributions"
:feature-ids="[id]"
:features="[poi]"
class="tw-relative poi-map"
Expand Down Expand Up @@ -258,7 +256,7 @@ function back() {
:color-line="colorLine"
:favorites-mode-enabled="favoritesModeEnabled"
/>
<Footer :attributions="settings.attributions">
<Footer :attributions="settings?.attributions">
<span v-if="poi.properties.metadata.updated_at">
{{ t('poiDetails.lastUpdate') }}
<a
Expand Down
7 changes: 2 additions & 5 deletions pages/poi/[id]/details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ definePageMeta({
// Composables
//
const siteStore = useSiteStore()
const { config, settings, contents } = storeToRefs(siteStore)
const { config, settings } = storeToRefs(siteStore)
const { params } = useRoute()
const { $trackingInit } = useNuxtApp()
Expand Down Expand Up @@ -92,10 +92,7 @@ useHead(

<template>
<PoiDetails
v-if="settings"
:settings="settings"
:nav-menu-entries="contents!"
:poi="poi!"
:poi="poi"
:poi-deps="poiDeps"
:page-title="featureSeoTitle!"
class="page-details tw-overflow-clip"
Expand Down

0 comments on commit b58887d

Please sign in to comment.