diff --git a/src/modules/nostr-feed/LINK_AGGREGATOR_PLAN.md b/src/modules/nostr-feed/LINK_AGGREGATOR_PLAN.md index f6ba525..a171006 100644 --- a/src/modules/nostr-feed/LINK_AGGREGATOR_PLAN.md +++ b/src/modules/nostr-feed/LINK_AGGREGATOR_PLAN.md @@ -86,11 +86,12 @@ Transform the nostr-feed module into a Reddit-style link aggregator with support - [x] Create `LinkPreviewService.ts` - OG tag fetching - [x] Extend `FeedService.ts` - Handle kind 1111 -### Phase 2: Post Creation (Pending) -- [ ] Create `SubmitComposer.vue` - Multi-type composer -- [ ] Add link preview on URL paste -- [ ] Integrate with pictrs for media upload -- [ ] Add NSFW toggle +### Phase 2: Post Creation +- [x] Create `SubmitComposer.vue` - Multi-type composer +- [x] Add link preview on URL paste +- [x] Add NSFW toggle +- [x] Add route `/submit` for composer +- [ ] Integrate with pictrs for media upload (Future) ### Phase 3: Feed Display - [x] Create `SubmissionRow.vue` - Link aggregator row (Reddit/Lemmy style) diff --git a/src/modules/nostr-feed/components/SubmitComposer.vue b/src/modules/nostr-feed/components/SubmitComposer.vue new file mode 100644 index 0000000..fcfd6bf --- /dev/null +++ b/src/modules/nostr-feed/components/SubmitComposer.vue @@ -0,0 +1,406 @@ + + + + + Create Post + + + + + + You must be logged in to create a post + + + + + + + + Text + + + + Link + + + + Image + + + + + + + + Title * + + + + {{ title.length }}/300 + + + + + + + URL * + + + + + + + + Loading preview... + + + + + + + {{ previewError }} + + + + + + + + + + + + + + + {{ linkPreview.domain }} + + + + + + {{ linkPreview.title }} + + + {{ linkPreview.description }} + + + + + + + + + + Thumbnail URL + (optional) + + + + + + + + Body + * + (optional) + + + + Markdown supported + + + + + + + + NSFW + + + Not Safe For Work + + + + + + + + {{ submitError }} + + + + + + + + Create + + + Cancel + + + + + diff --git a/src/modules/nostr-feed/index.ts b/src/modules/nostr-feed/index.ts index d57398d..af179fd 100644 --- a/src/modules/nostr-feed/index.ts +++ b/src/modules/nostr-feed/index.ts @@ -6,6 +6,7 @@ import SubmissionList from './components/SubmissionList.vue' import SubmissionRow from './components/SubmissionRow.vue' import SubmissionDetail from './components/SubmissionDetail.vue' import SubmissionComment from './components/SubmissionComment.vue' +import SubmitComposer from './components/SubmitComposer.vue' import VoteControls from './components/VoteControls.vue' import SortTabs from './components/SortTabs.vue' import { useFeed } from './composables/useFeed' @@ -34,6 +35,15 @@ export const nostrFeedModule: ModulePlugin = { title: 'Submission', requiresAuth: false } + }, + { + path: '/submit', + name: 'submit-post', + component: () => import('./views/SubmitPage.vue'), + meta: { + title: 'Create Post', + requiresAuth: true + } } ], @@ -92,6 +102,7 @@ export const nostrFeedModule: ModulePlugin = { SubmissionRow, SubmissionDetail, SubmissionComment, + SubmitComposer, VoteControls, SortTabs }, diff --git a/src/modules/nostr-feed/views/SubmitPage.vue b/src/modules/nostr-feed/views/SubmitPage.vue new file mode 100644 index 0000000..129208a --- /dev/null +++ b/src/modules/nostr-feed/views/SubmitPage.vue @@ -0,0 +1,35 @@ + + + + +
+ {{ linkPreview.description }} +