This commit is contained in:
Ren Amamiya
2023-07-27 09:02:04 +07:00
parent f52ea04541
commit 343e1a12d6
13 changed files with 486 additions and 284 deletions

View File

@@ -21,9 +21,13 @@ import { useImageUploader } from '@utils/hooks/useUploader';
import { sendNativeNotification } from '@utils/notification';
export function Composer() {
const { publish } = usePublish();
const [status, setStatus] = useState<null | 'loading' | 'done'>(null);
const [reply, clearReply] = useComposer((state) => [state.reply, state.clearReply]);
const upload = useImageUploader();
const editor = useEditor({
extensions: [
StarterKit.configure({
@@ -56,9 +60,6 @@ export function Composer() {
},
});
const upload = useImageUploader();
const { publish } = usePublish();
const uploadImage = async (file?: string) => {
const image = await upload(file);
if (image.url) {

View File

@@ -5,10 +5,9 @@ import { getAllMetadata } from '@libs/storage';
import { MentionList } from '@shared/composer';
const users = await getAllMetadata();
export const Suggestion = {
items: ({ query }) => {
items: async ({ query }) => {
const users = await getAllMetadata();
return users
.filter((item) => item.ident.toLowerCase().startsWith(query.toLowerCase()))
.slice(0, 5);