+
+ Share your thoughts with the community
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/Home.vue b/src/pages/Home.vue
index a64f606..43f7486 100644
--- a/src/pages/Home.vue
+++ b/src/pages/Home.vue
@@ -1,32 +1,92 @@
-
+
-
-
-
-
-
- Content Filters
-
-
- Choose what types of content you want to see in your feed
-
-
-
-
-
-
+
+
+
+
Feed
+
+
+
+ {{ activeFilterCount }} filters
+ All content
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -37,20 +97,50 @@
// import NotificationPermission from '@/components/notifications/NotificationPermission.vue'
import { ref, computed, watch } from 'vue'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
-import { Filter } from 'lucide-vue-next'
+import { Filter, Plus } from 'lucide-vue-next'
import PWAInstallPrompt from '@/components/pwa/PWAInstallPrompt.vue'
import FeedFilters from '@/modules/nostr-feed/components/FeedFilters.vue'
+import NoteComposer from '@/modules/nostr-feed/components/NoteComposer.vue'
+import NostrFeed from '@/modules/nostr-feed/components/NostrFeed.vue'
import { FILTER_PRESETS } from '@/modules/nostr-feed/config/content-filters'
import appConfig from '@/app.config'
import type { ContentFilter } from '@/modules/nostr-feed/services/FeedService'
+import type { ReplyToNote } from '@/modules/nostr-feed/components/NoteComposer.vue'
// Get admin pubkeys from app config
const adminPubkeys = appConfig.modules['nostr-feed']?.config?.adminPubkeys || []
+// UI state
+const showFilters = ref(false)
+const showComposer = ref(false)
+
// Feed configuration
const selectedFilters = ref(FILTER_PRESETS.all)
const feedKey = ref(0) // Force feed component to re-render when filters change
+// Note composer state
+const replyTo = ref()
+
+// Quick filter presets for mobile bottom bar
+const quickFilterPresets = {
+ all: { label: 'All', filters: FILTER_PRESETS.all },
+ announcements: { label: 'News', filters: FILTER_PRESETS.announcements },
+ marketplace: { label: 'Market', filters: FILTER_PRESETS.marketplace },
+ social: { label: 'Social', filters: FILTER_PRESETS.social },
+ events: { label: 'Events', filters: FILTER_PRESETS.events }
+}
+
+// Computed properties
+const activeFilterCount = computed(() => selectedFilters.value.length)
+
+const isPresetActive = (presetKey: string) => {
+ const preset = quickFilterPresets[presetKey as keyof typeof quickFilterPresets]
+ if (!preset) return false
+
+ return preset.filters.length === selectedFilters.value.length &&
+ preset.filters.every(pf => selectedFilters.value.some(sf => sf.id === pf.id))
+}
+
// Determine feed type based on selected filters
const feedType = computed(() => {
if (selectedFilters.value.length === 0) return 'all'
@@ -70,4 +160,37 @@ const feedType = computed(() => {
watch(selectedFilters, () => {
feedKey.value++
}, { deep: true })
+
+// Handle note composer events
+// Methods
+const setQuickFilter = (presetKey: string) => {
+ const preset = quickFilterPresets[presetKey as keyof typeof quickFilterPresets]
+ if (preset) {
+ selectedFilters.value = preset.filters
+ }
+}
+
+const onNotePublished = (noteId: string) => {
+ console.log('Note published:', noteId)
+ // Refresh the feed to show the new note
+ feedKey.value++
+ // Clear reply state and hide composer
+ replyTo.value = undefined
+ showComposer.value = false
+}
+
+const onClearReply = () => {
+ replyTo.value = undefined
+ showComposer.value = false
+}
+
+const onReplyToNote = (note: ReplyToNote) => {
+ replyTo.value = note
+ showComposer.value = true
+}
+
+const onCloseComposer = () => {
+ showComposer.value = false
+ replyTo.value = undefined
+}