diff --git a/src/app.css b/src/app.css index a9a0e5fc..d7f5d15b 100644 --- a/src/app.css +++ b/src/app.css @@ -114,6 +114,9 @@ input::-ms-clear { inset: 20px 20px auto auto; cursor: zoom-out; z-index: 1; + display: flex; + align-items: center; + justify-content: center; } [data-rmiz-content="found"] img, @@ -153,7 +156,8 @@ input::-ms-clear { } [data-rmiz-modal-overlay="visible"] { - background-color: rgba(255, 255, 255, 1); + background-color: rgba(255, 255, 255, 0.5); + backdrop-filter: blur(4px); } [data-rmiz-modal-content] { diff --git a/src/app/new/components/mentionPopupItem.tsx b/src/app/new/components/mentionPopupItem.tsx index c2fa6614..d4e8f95d 100644 --- a/src/app/new/components/mentionPopupItem.tsx +++ b/src/app/new/components/mentionPopupItem.tsx @@ -1,5 +1,3 @@ -import { Image } from '@shared/image'; - import { useProfile } from '@utils/hooks/useProfile'; import { displayNpub } from '@utils/shortenKey'; @@ -20,7 +18,7 @@ export function MentionPopupItem({ pubkey, embed }: { pubkey: string; embed?: st return (
- {user?.about} -
-- {profile.about || profile.bio} -
+Loading...
) : ( diff --git a/src/shared/widgets/notification.tsx b/src/shared/widgets/notification.tsx index ac343e62..e002f474 100644 --- a/src/shared/widgets/notification.tsx +++ b/src/shared/widgets/notification.tsx @@ -11,6 +11,8 @@ import { MemoizedNotifyNote, NoteSkeleton } from '@shared/notes'; import { TitleBar } from '@shared/titleBar'; import { WidgetWrapper } from '@shared/widgets'; +import { FETCH_LIMIT } from '@stores/constants'; + import { useNostr } from '@utils/hooks/useNostr'; import { sendNativeNotification } from '@utils/notification'; @@ -37,7 +39,7 @@ export function NotificationWidget() { kinds: [NDKKind.Text, NDKKind.Repost, NDKKind.Reaction, NDKKind.Zap], '#p': [db.account.pubkey], }, - 20, + FETCH_LIMIT, { asOf: pageParam === 0 ? undefined : pageParam, abortSignal: signal } ); diff --git a/src/stores/constants.ts b/src/stores/constants.ts index 7b22c168..34412fc0 100644 --- a/src/stores/constants.ts +++ b/src/stores/constants.ts @@ -8,7 +8,7 @@ export const FULL_RELAYS = [ 'wss://nostr.mutinywallet.com', ]; -export const FETCH_LIMIT = 50; +export const FETCH_LIMIT = 20; export const WidgetKinds = { local: { diff --git a/src/utils/parser.ts b/src/utils/parser.ts deleted file mode 100644 index 72522223..00000000 --- a/src/utils/parser.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { nip19 } from 'nostr-tools'; -import { - AddressPointer, - EventPointer, - ProfilePointer, -} from 'nostr-tools/lib/types/nip19'; - -import { RichContent } from '@utils/types'; - -function isURL(string: string) { - try { - const url = new URL(string); - if (url.protocol.length > 0) { - if (url.protocol === 'https:' || url.protocol === 'http:') { - return true; - } else { - return false; - } - } - return true; - } catch (e) { - return false; - } -} - -export function parser(content: string) { - const richContent: RichContent = { - parsed: null, - images: [], - videos: [], - links: [], - notes: [], - }; - - const parsed = content - .trim() - .split(/(\s+)/) - .map((word) => { - // url - if (isURL(word)) { - const url = new URL(word); - url.search = ''; - - if (url.pathname.match(/\.(jpg|jpeg|gif|png|webp|avif|tiff)$/)) { - // image url - richContent.images.push(word); - // remove url from original content - return word.replace(word, ''); - } - - if (url.pathname.match(/\.(mp4|mov|webm|wmv|flv|mts|avi|ogv|mkv|mp3|m3u8)$/)) { - // video url - richContent.videos.push(word); - // remove url from original content - return word.replace(word, ''); - } - - // normal url - if (richContent.links.length < 1) { - richContent.links.push(url.toString()); - } - } - - // hashtag - if (word.startsWith('#') && word.length > 1) { - return word.replace(word, `