feat(column): add hashtag column

This commit is contained in:
2023-12-30 17:33:04 +07:00
parent ddbbcf41b5
commit b1d2496f8e
22 changed files with 533 additions and 52 deletions

View File

@@ -8,6 +8,7 @@
"build": "vite build"
},
"dependencies": {
"@columns/hashtag": "workspace:^",
"@columns/notification": "workspace:^",
"@columns/thread": "workspace:^",
"@columns/timeline": "workspace:^",

View File

@@ -1,9 +1,10 @@
import { Hashtag } from "@columns/hashtag";
import { Thread } from "@columns/thread";
import { Timeline } from "@columns/timeline";
import { User } from "@columns/user";
import { useColumnContext } from "@lume/ark";
import { IColumn } from "@lume/types";
import { WIDGET_KIND } from "@lume/utils";
import { COL_TYPES } from "@lume/utils";
import { useRef, useState } from "react";
import { VList, VListHandle } from "virtua";
@@ -14,12 +15,14 @@ export function HomeScreen() {
const renderItem = (column: IColumn) => {
switch (column.kind) {
case WIDGET_KIND.newsfeed:
case COL_TYPES.newsfeed:
return <Timeline key={column.id} />;
case WIDGET_KIND.thread:
return <Thread key={column.id} thread={column} />;
case WIDGET_KIND.user:
return <User key={column.id} user={column} />;
case COL_TYPES.thread:
return <Thread key={column.id} column={column} />;
case COL_TYPES.user:
return <User key={column.id} column={column} />;
case COL_TYPES.hashtag:
return <Hashtag key={column.id} column={column} />;
default:
return <Timeline key={column.id} />;
}
@@ -64,7 +67,6 @@ export function HomeScreen() {
}}
>
{columns.map((column) => renderItem(column))}
<div className="h-full w-[200px]" />
</VList>
</div>
);

View File

@@ -1,6 +1,6 @@
import { MentionNote, useArk, useSuggestion, useWidget } from "@lume/ark";
import { CancelIcon, LoaderIcon } from "@lume/icons";
import { WIDGET_KIND } from "@lume/utils";
import { COL_TYPES } from "@lume/utils";
import { NDKKind } from "@nostr-dev-kit/ndk";
import CharacterCount from "@tiptap/extension-character-count";
import Image from "@tiptap/extension-image";
@@ -101,7 +101,7 @@ export function NewPostScreen() {
addWidget.mutate({
title: "Thread",
content: publish.id,
kind: WIDGET_KIND.thread,
kind: COL_TYPES.thread,
});
}