Updated Map View
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from "vue"
|
||||
import {ref, computed, watch} from "vue"
|
||||
import ProfileLayout from "@/Components/FlightsGoneBy/ProfileLayout.vue"
|
||||
import ProfileViewSwitcher from "@/Components/FlightsGoneBy/ProfileViewSwitcher.vue"
|
||||
import AchievementCard from "@/Components/FlightsGoneBy/AchievementCard.vue"
|
||||
@@ -8,23 +8,31 @@ import {Head, usePage} from "@inertiajs/vue3";
|
||||
import MainLayout from "@/Layouts/MainLayout.vue";
|
||||
import Panel from "@/Components/FlightsGoneBy/Panels/Panel.vue";
|
||||
import PanelHeader from "@/Components/FlightsGoneBy/Panels/PanelHeader.vue";
|
||||
import {useUpdateSetting} from "@/Composables/useUpdateSetting";
|
||||
|
||||
const {updateSetting} = useUpdateSetting()
|
||||
|
||||
defineOptions({ layout: MainLayout })
|
||||
|
||||
const props = defineProps<{
|
||||
user: User
|
||||
canEdit: boolean
|
||||
isFollowing: boolean
|
||||
followStatus: string
|
||||
achievements: Record<string, Achievement[]>
|
||||
userAchievements: Record<number, UserAchievement>
|
||||
unlockedCount: number
|
||||
totalAchievements: number
|
||||
unlockedByCategory: Record<string, number>
|
||||
canView: boolean
|
||||
}>()
|
||||
|
||||
const page = usePage<SharedProps>().props
|
||||
|
||||
const hideImpossible = ref(false)
|
||||
const hideImpossible = ref(page.auth?.user?.resolved_settings?.hide_impossible_achievements ?? false)
|
||||
|
||||
watch(hideImpossible, (value) => {
|
||||
updateSetting('hide_impossible_achievements', value).catch(() => {})
|
||||
})
|
||||
|
||||
const filteredAchievements = computed(() => {
|
||||
if (!hideImpossible.value) return props.achievements
|
||||
@@ -56,12 +64,13 @@ const filteredUnlockedCount = computed(() =>
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head :title="`${user.name}'s Achievements`" />
|
||||
<ProfileLayout
|
||||
:user="user"
|
||||
:achievementCount="unlockedCount"
|
||||
:is-following="isFollowing"
|
||||
:followStatus="followStatus"
|
||||
:loading="false"
|
||||
:canView="canView"
|
||||
:title="`${user.name}'s Achievements`"
|
||||
>
|
||||
<ProfileViewSwitcher active-view="achievements" :user="user" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user