From 2abeabf1171c0283138caf5e0eb4be8235f0bfa3 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Thu, 7 May 2026 17:13:35 +0200 Subject: [PATCH] composer: complete! (ish) --- src/components/Composer.tsx | 57 +++++++++++++++++++------- src/components/primitive/Button.tsx | 13 +++++- src/components/primitive/Select.tsx | 6 +-- src/lib/richtext/convert.ts | 63 +++++++++++++++++++++++++++++ src/lib/richtext/editor-dom.tsx | 11 ++++- src/lib/richtext/editor.tsx | 6 ++- src/lib/richtext/index.ts | 2 + 7 files changed, 134 insertions(+), 24 deletions(-) create mode 100644 src/lib/richtext/convert.ts create mode 100644 src/lib/richtext/index.ts diff --git a/src/components/Composer.tsx b/src/components/Composer.tsx index 5ab7e23..16ea114 100644 --- a/src/components/Composer.tsx +++ b/src/components/Composer.tsx @@ -1,11 +1,13 @@ -import { StyleSheet, TextInput, View } from "react-native"; +import { StyleSheet, View } from "react-native"; import { Text } from "./primitive/Text"; import { Button } from "./primitive/Button"; -import { useContext, useEffect, useMemo, useState } from "react"; +import { useContext, useEffect, useState } from "react"; import { AuthContext } from "../context/AuthContext"; import { Profile, resolveProfile } from "../lib/profile"; import { RichTextEditor } from "../lib/richtext/editor"; import { useRouter } from "expo-router"; +import { RichTextContent } from "../lib/richtext"; +import { dev } from "../lexicons"; const styles = StyleSheet.create({ composerHeader: { @@ -61,10 +63,14 @@ function ComposerHeader() { ); } -function ComposerBody() { +function ComposerBody({ + onChange, +}: { + onChange: (content: RichTextContent) => void; +}) { return ( - + ); } @@ -72,34 +78,57 @@ function ComposerBody() { function ComposerFooter({ onPublish, onCancel, + disabled, }: { onPublish: () => void; onCancel: () => void; + disabled?: boolean; }) { return ( -