diff --git a/src/shared/composer/modal.tsx b/src/shared/composer/modal.tsx index 0dd9c8f5..b81f7a7d 100644 --- a/src/shared/composer/modal.tsx +++ b/src/shared/composer/modal.tsx @@ -1,15 +1,22 @@ -import { ComposeUser } from '@lume/shared/composer/user'; +import { Post } from '@lume/shared/composer/types/post'; +import { User } from '@lume/shared/composer/user'; import CancelIcon from '@lume/shared/icons/cancel'; import ChevronDownIcon from '@lume/shared/icons/chevronDown'; import ChevronRightIcon from '@lume/shared/icons/chevronRight'; import ComposeIcon from '@lume/shared/icons/compose'; +import { composerAtom } from '@lume/stores/composer'; import { useActiveAccount } from '@lume/utils/hooks/useActiveAccount'; import { Dialog, Transition } from '@headlessui/react'; +import { useAtom } from 'jotai'; import { Fragment, useState } from 'react'; -export const ComposerModal = () => { +import PlusCircleIcon from '../icons/plusCircle'; + +export function ComposerModal() { const [isOpen, setIsOpen] = useState(false); + const [composer] = useAtom(composerAtom); + const { account, isLoading, isError } = useActiveAccount(); const closeModal = () => { @@ -56,11 +63,14 @@ export const ComposerModal = () => {
-
{!isLoading && !isError && account && }
+
{!isLoading && !isError && account && }
- @@ -69,7 +79,25 @@ export const ComposerModal = () => {
-
+
+
+
+
+
+ {composer.type === 'post' && } +
+
+ + +
+
@@ -77,4 +105,4 @@ export const ComposerModal = () => { ); -}; +} diff --git a/src/shared/composer/types/post.tsx b/src/shared/composer/types/post.tsx new file mode 100644 index 00000000..c290fa70 --- /dev/null +++ b/src/shared/composer/types/post.tsx @@ -0,0 +1,3 @@ +export function Post() { + return
; +} diff --git a/src/shared/composer/user.tsx b/src/shared/composer/user.tsx index 3eed6acc..6f177781 100644 --- a/src/shared/composer/user.tsx +++ b/src/shared/composer/user.tsx @@ -1,16 +1,16 @@ import { Image } from '@lume/shared/image'; import { DEFAULT_AVATAR, IMGPROXY_URL } from '@lume/stores/constants'; -export const ComposeUser = ({ data }: { data: any }) => { +export function User({ data }: { data: any }) { const metadata = JSON.parse(data.metadata); return ( -
-
+
+
{data.pubkey}
@@ -21,4 +21,4 @@ export const ComposeUser = ({ data }: { data: any }) => {
); -}; +} diff --git a/src/shared/icons/plusCircle.tsx b/src/shared/icons/plusCircle.tsx new file mode 100644 index 00000000..ce7478da --- /dev/null +++ b/src/shared/icons/plusCircle.tsx @@ -0,0 +1,15 @@ +import { SVGProps } from 'react'; + +export default function PlusCircleIcon(props: JSX.IntrinsicAttributes & SVGProps) { + return ( + + + + ); +} diff --git a/src/stores/composer.tsx b/src/stores/composer.tsx new file mode 100644 index 00000000..d7bd6534 --- /dev/null +++ b/src/stores/composer.tsx @@ -0,0 +1,3 @@ +import { atomWithReset } from 'jotai/utils'; + +export const composerAtom = atomWithReset({ type: 'post', content: '' });