prepared for ver 0.1.0

This commit is contained in:
Ren Amamiya 2023-02-24 07:54:39 +07:00
parent 4b73715927
commit d1fd80e15a
24 changed files with 19 additions and 23 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 974 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 903 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 159 KiB

View File

@ -23,7 +23,7 @@
}, },
"bundle": { "bundle": {
"active": true, "active": true,
"category": "DeveloperTool", "category": "SocialNetworking",
"copyright": "", "copyright": "",
"deb": { "deb": {
"depends": [] "depends": []
@ -36,7 +36,7 @@
"icons/icon.icns", "icons/icon.icns",
"icons/icon.ico" "icons/icon.ico"
], ],
"identifier": "com.tauri.dev", "identifier": "com.uselume.xyz",
"longDescription": "", "longDescription": "",
"macOS": { "macOS": {
"entitlements": null, "entitlements": null,

View File

@ -6,7 +6,7 @@ import { ImageCard } from '@components/note/content/preview/imageCard';
import { Video } from '@components/note/content/preview/video'; import { Video } from '@components/note/content/preview/video';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import ReactPlayer from 'react-player'; import ReactPlayer from 'react-player';
const MarkdownPreview = dynamic(() => import('@uiw/react-markdown-preview'), { const MarkdownPreview = dynamic(() => import('@uiw/react-markdown-preview'), {
@ -14,7 +14,7 @@ const MarkdownPreview = dynamic(() => import('@uiw/react-markdown-preview'), {
loading: () => <div className="h-4 w-36 animate-pulse rounded bg-zinc-700" />, loading: () => <div className="h-4 w-36 animate-pulse rounded bg-zinc-700" />,
}); });
export default function Content({ data }: { data: any }) { export const Content = memo(function Content({ data }: { data: any }) {
const [preview, setPreview] = useState({}); const [preview, setPreview] = useState({});
const content = useRef(data.content); const content = useRef(data.content);
@ -96,4 +96,4 @@ export default function Content({ data }: { data: any }) {
</div> </div>
</div> </div>
); );
} });

View File

@ -1,5 +1,5 @@
import { UserWithUsername } from '@components/note/atoms/userWithUsername'; import { UserWithUsername } from '@components/note/atoms/userWithUsername';
import Content from '@components/note/content'; import { Content } from '@components/note/content';
import NoteReply from '@components/note/modal/noteReply'; import NoteReply from '@components/note/modal/noteReply';
import { useNostrEvents } from 'nostr-react'; import { useNostrEvents } from 'nostr-react';
@ -24,7 +24,7 @@ const Modal = ({ event }: { event: any }) => {
<div className="relative h-full overflow-auto rounded-lg border-[0.5px] border-white/30 bg-zinc-800 p-4 shadow-inner"> <div className="relative h-full overflow-auto rounded-lg border-[0.5px] border-white/30 bg-zinc-800 p-4 shadow-inner">
<div className="flex flex-col gap-4"> <div className="flex flex-col gap-4">
<UserWithUsername pubkey={event.pubkey} /> <UserWithUsername pubkey={event.pubkey} />
<Content data={event.content} /> <Content data={event} />
</div> </div>
<div className="flex flex-col gap-2 divide-y divide-zinc-700"> <div className="flex flex-col gap-2 divide-y divide-zinc-700">
{events.map((item) => ( {events.map((item) => (

View File

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { User } from '@components/note/atoms/user'; import { User } from '@components/note/atoms/user';
import Content from '@components/note/content'; import { Content } from '@components/note/content';
export default function NoteReply({ event }: { event: any }) { export default function NoteReply({ event }: { event: any }) {
return ( return (

View File

@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import { UserRepost } from '@components/note/atoms/userRepost'; import { UserRepost } from '@components/note/atoms/userRepost';
import Content from '@components/note/content'; import { Content } from '@components/note/content';
import { Placeholder } from '@components/note/placeholder'; import { Placeholder } from '@components/note/placeholder';
import RepostIcon from '@assets/icons/Repost'; import RepostIcon from '@assets/icons/Repost';
@ -24,7 +24,7 @@ export const Repost = memo(function Repost({ root, user }: { root: any; user: st
}, },
}); });
if (events !== null) { if (events !== null && Object.keys(events).length > 0) {
return ( return (
<Dialog.Root> <Dialog.Root>
<Dialog.Trigger> <Dialog.Trigger>
@ -35,12 +35,12 @@ export const Repost = memo(function Repost({ root, user }: { root: any; user: st
<UserRepost pubkey={user} /> <UserRepost pubkey={user} />
</div> </div>
</div> </div>
<Content data={events[0]} /> {events[0].content && <Content data={events[0]} />}
</div> </div>
<Dialog.Portal> <Dialog.Portal>
<Dialog.Overlay className="fixed inset-0 bg-black bg-opacity-30 backdrop-blur-sm data-[state=open]:animate-overlayShow" /> <Dialog.Overlay className="fixed inset-0 bg-black bg-opacity-30 backdrop-blur-sm data-[state=open]:animate-overlayShow" />
<Dialog.Content className="fixed inset-0 overflow-y-auto"> <Dialog.Content className="fixed inset-0 overflow-y-auto">
<Modal event={events[0]} /> {events[0].content && <Modal event={events[0]} />}
</Dialog.Content> </Dialog.Content>
</Dialog.Portal> </Dialog.Portal>
</Dialog.Trigger> </Dialog.Trigger>

View File

@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-explicit-any */
import Content from '@components/note/content'; import { Content } from '@components/note/content';
import * as Dialog from '@radix-ui/react-dialog'; import * as Dialog from '@radix-ui/react-dialog';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
@ -12,8 +12,6 @@ const Modal = dynamic(() => import('@components/note/modal'), {
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
export const Single = memo(function Single({ event }: { event: any }) { export const Single = memo(function Single({ event }: { event: any }) {
console.log(event);
return ( return (
<Dialog.Root> <Dialog.Root>
<Dialog.Trigger asChild> <Dialog.Trigger asChild>

View File

@ -4,7 +4,7 @@ import OnboardingLayout from '@layouts/onboardingLayout';
import { motion } from 'framer-motion'; import { motion } from 'framer-motion';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import { getPublicKey, nip19 } from 'nostr-tools'; import { nip19 } from 'nostr-tools';
import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from 'react'; import { JSXElementConstructor, ReactElement, ReactFragment, ReactPortal } from 'react';
import { Resolver, useForm } from 'react-hook-form'; import { Resolver, useForm } from 'react-hook-form';
@ -36,17 +36,15 @@ export default function Page() {
} = useForm<FormValues>({ resolver }); } = useForm<FormValues>({ resolver });
const onSubmit = async (data: any) => { const onSubmit = async (data: any) => {
let privKey = data['key']; let privkey = data['key'];
if (privKey.substring(0, 4) === 'nsec') { if (privkey.substring(0, 4) === 'nsec') {
privKey = nip19.decode(privKey).data; privkey = nip19.decode(privkey).data;
} }
try { try {
const pubKey = getPublicKey(privKey); if (privkey) {
router.push(`/onboarding/profile/${privkey}`);
if (pubKey) {
router.push(`/onboarding/profile/${privKey}`);
} }
} catch (error) { } catch (error) {
setError('key', { setError('key', {