chore: Update project metadata and dependencies
- Change project title from "Atitlán Directory" to "Ariège Hub" in index.html - Update app title in meta tags for PWA support - Add @tanstack/vue-table dependency for enhanced table management - Refactor ConnectionStatus component to improve status variant logic - Enhance useEvents composable for better error handling and sorting - Add 'events' translation to Spanish and French locales - Create a new Pinia store for Nostr state management
This commit is contained in:
parent
de73230525
commit
3c05ddde51
9 changed files with 72 additions and 13 deletions
|
|
@ -1,5 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, onUnmounted, ref } from 'vue'
|
||||
import { onMounted, onUnmounted } from 'vue'
|
||||
import Navbar from '@/components/layout/Navbar.vue'
|
||||
import Footer from '@/components/layout/Footer.vue'
|
||||
import ConnectionStatus from '@/components/nostr/ConnectionStatus.vue'
|
||||
|
|
|
|||
|
|
@ -8,9 +8,10 @@ const props = defineProps<{
|
|||
error?: Error | null
|
||||
}>()
|
||||
|
||||
function getStatusVariant() {
|
||||
if (props.isConnecting) return 'warning'
|
||||
return props.isConnected ? 'success' : 'destructive'
|
||||
function getStatusVariant(): 'default' | 'destructive' | 'outline' | 'secondary' {
|
||||
if (!props.isConnected) return 'destructive'
|
||||
if (props.isConnecting) return 'secondary'
|
||||
return 'outline'
|
||||
}
|
||||
|
||||
function getStatusText() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useAsyncState } from '@vueuse/core'
|
||||
import type { Event } from '@/lib/types/event'
|
||||
import { fetchEvents } from '@/lib/api/events'
|
||||
|
|
@ -16,8 +16,8 @@ export function useEvents() {
|
|||
const error = computed(() => {
|
||||
if (asyncError.value) {
|
||||
return {
|
||||
message: asyncError.value instanceof Error
|
||||
? asyncError.value.message
|
||||
message: asyncError.value instanceof Error
|
||||
? asyncError.value.message
|
||||
: 'An error occurred while fetching events'
|
||||
}
|
||||
}
|
||||
|
|
@ -25,21 +25,21 @@ export function useEvents() {
|
|||
})
|
||||
|
||||
const sortedEvents = computed(() => {
|
||||
return [...events.value].sort((a, b) =>
|
||||
return [...events.value].sort((a, b) =>
|
||||
new Date(b.time).getTime() - new Date(a.time).getTime()
|
||||
)
|
||||
})
|
||||
|
||||
const upcomingEvents = computed(() => {
|
||||
const now = new Date()
|
||||
return sortedEvents.value.filter(event =>
|
||||
return sortedEvents.value.filter(event =>
|
||||
new Date(event.event_start_date) > now
|
||||
)
|
||||
})
|
||||
|
||||
const pastEvents = computed(() => {
|
||||
const now = new Date()
|
||||
return sortedEvents.value.filter(event =>
|
||||
return sortedEvents.value.filter(event =>
|
||||
new Date(event.event_end_date) < now
|
||||
)
|
||||
})
|
||||
|
|
@ -52,4 +52,4 @@ export function useEvents() {
|
|||
error,
|
||||
refresh,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ const messages: LocaleMessages = {
|
|||
directory: 'Directorio',
|
||||
faq: 'Preguntas Frecuentes',
|
||||
support: 'Soporte',
|
||||
events: 'Eventos',
|
||||
login: 'Iniciar Sesión',
|
||||
logout: 'Cerrar Sesión'
|
||||
},
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ const messages: LocaleMessages = {
|
|||
directory: 'Répertoire',
|
||||
faq: 'FAQ',
|
||||
support: 'Support',
|
||||
events: 'Événements',
|
||||
login: 'Connexion',
|
||||
logout: 'Déconnexion'
|
||||
},
|
||||
|
|
|
|||
22
src/stores/nostr.ts
Normal file
22
src/stores/nostr.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
|
||||
export const useNostrStore = defineStore('nostr', () => {
|
||||
const isConnected = ref(false)
|
||||
const relayUrls = ref<string[]>([])
|
||||
|
||||
function setConnected(value: boolean) {
|
||||
isConnected.value = value
|
||||
}
|
||||
|
||||
function setRelayUrls(urls: string[]) {
|
||||
relayUrls.value = urls
|
||||
}
|
||||
|
||||
return {
|
||||
isConnected,
|
||||
relayUrls,
|
||||
setConnected,
|
||||
setRelayUrls,
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue