fix small issues

This commit is contained in:
Ren Amamiya 2023-08-24 15:23:54 +07:00
parent 970115d059
commit 98687bd78b
7 changed files with 11 additions and 30 deletions

View File

@ -99,7 +99,7 @@ export function MigrateScreen() {
Upgrade security for your account
</h1>
</div>
<div className="w-full rounded-xl border-t border-zinc-800/50 bg-zinc-900 px-3 py-3">
<div className="w-full rounded-xl bg-white/10 px-3 py-3">
<div className="flex flex-col gap-4">
<div>
<div className="mt-1">

View File

@ -15,7 +15,7 @@ button {
}
.markdown {
@apply prose prose-white max-w-none select-text hyphens-auto text-white prose-p:mb-2 prose-p:mt-0 prose-p:break-words prose-p:[word-break:break-word] prose-p:last:mb-0 prose-a:break-words prose-a:break-all prose-a:font-normal prose-a:leading-tight prose-a:after:content-['_↗'] hover:prose-a:text-fuchsia-500 prose-blockquote:mb-1 prose-blockquote:mt-1 prose-blockquote:border-l-[2px] prose-blockquote:border-fuchsia-500 prose-blockquote:pl-2 prose-pre:whitespace-pre-wrap prose-pre:break-words prose-pre:break-all prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-ul:mt-1 prose-li:leading-tight prose-img:mb-2 prose-img:mt-3 prose-hr:mx-0 prose-hr:my-2;
@apply prose prose-white max-w-none select-text hyphens-auto text-white prose-p:mb-2 prose-p:mt-0 prose-p:break-words prose-p:[word-break:break-word] prose-p:last:mb-0 prose-a:break-words prose-a:break-all prose-a:font-normal prose-a:leading-tight prose-a:after:content-['_↗'] hover:prose-a:text-fuchsia-500 prose-blockquote:mb-1 prose-blockquote:mt-1 prose-blockquote:border-l-[2px] prose-blockquote:border-fuchsia-500 prose-blockquote:pl-2 prose-pre:whitespace-pre-wrap prose-pre:break-words prose-pre:break-all prose-ol:m-0 prose-ol:mb-1 prose-ul:mb-1 prose-ul:mt-1 prose-img:mb-2 prose-img:mt-3 prose-hr:mx-0 prose-hr:my-2;
}
.ProseMirror p.is-empty::before {
@ -52,12 +52,3 @@ iframe {
span[data-slate-placeholder] {
@apply top-0;
}
@keyframes loop {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-50%);
}
}

View File

@ -25,7 +25,7 @@ export function TextNote({ event }: { event: NDKEvent }) {
components={{
del: ({ children }) => {
const key = children[0] as string;
if (!key) return;
if (typeof key !== 'string') return;
if (key.startsWith('pub') && key.length > 50 && key.length < 100)
return <MentionUser pubkey={key.replace('pub-', '')} />;
if (key.startsWith('tag')) return <Hashtag tag={key.replace('tag-', '')} />;

View File

@ -16,7 +16,7 @@ export function Hashtag({ tag }: { tag: string }) {
content: tag.replace('#', ''),
})
}
className="break-words font-normal text-orange-400 no-underline hover:text-orange-500"
className="break-words text-fuchsia-400 hover:text-fuchsia-500"
>
{tag}
</button>

View File

@ -21,7 +21,7 @@ export function MentionUser({ pubkey }: { pubkey: string }) {
content: pubkey,
})
}
className="break-words font-normal text-blue-400 no-underline hover:text-blue-500"
className="break-words text-fuchsia-400 hover:text-fuchsia-500"
>
{user?.nip05 ||
user?.name ||

View File

@ -1,14 +1,9 @@
import { useMemo } from 'react';
import { NoteActions, NoteContent, SubReply } from '@shared/notes';
import { NoteActions, SubReply, TextNote } from '@shared/notes';
import { User } from '@shared/user';
import { parser } from '@utils/parser';
import { NDKEventWithReplies } from '@utils/types';
export function Reply({ event, root }: { event: NDKEventWithReplies; root?: string }) {
const content = useMemo(() => parser(event), [event]);
return (
<div className="h-min w-full py-1.5">
<div className="relative overflow-hidden rounded-xl bg-white/10 px-3 pt-3">
@ -17,8 +12,8 @@ export function Reply({ event, root }: { event: NDKEventWithReplies; root?: stri
<div className="relative z-20 -mt-6 flex items-start gap-3">
<div className="w-11 shrink-0" />
<div className="flex-1">
<NoteContent content={content} />
<NoteActions id={event.id || event.id} pubkey={event.pubkey} root={root} />
<TextNote event={event} />
<NoteActions id={event.id} pubkey={event.pubkey} root={root} />
</div>
</div>
<div>

View File

@ -1,22 +1,17 @@
import { NDKEvent } from '@nostr-dev-kit/ndk';
import { useMemo } from 'react';
import { NoteActions, NoteContent } from '@shared/notes';
import { NoteActions, TextNote } from '@shared/notes';
import { User } from '@shared/user';
import { parser } from '@utils/parser';
export function SubReply({ event }: { event: NDKEvent }) {
const content = useMemo(() => parser(event), [event]);
return (
<div className="relative mb-3 mt-5 flex flex-col">
<User pubkey={event.pubkey} time={event.created_at} />
<div className="relative z-20 -mt-6 flex items-start gap-3">
<div className="w-11 shrink-0" />
<div className="flex-1">
<NoteContent content={content} />
<NoteActions id={event.id || event.id} pubkey={event.pubkey} />
<TextNote event={event} />
<NoteActions id={event.id} pubkey={event.pubkey} />
</div>
</div>
</div>