mirror of
https://github.com/aljazceru/rabbit.git
synced 2025-12-17 14:04:21 +01:00
fix
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Show } from 'solid-js';
|
||||
|
||||
import { Kind } from 'nostr-tools';
|
||||
|
||||
// eslint-disable-next-line import/no-cycle
|
||||
import EventDisplayById from '@/components/event/EventDisplayById';
|
||||
import EventLink from '@/components/EventLink';
|
||||
@@ -20,6 +22,7 @@ const MentionedEventDisplay = (props: MentionedEventDisplayProps) => {
|
||||
eventId={props.mentionedEvent.eventId}
|
||||
embedding={false}
|
||||
actions={false}
|
||||
ensureKinds={[Kind.Text]}
|
||||
/>
|
||||
</div>
|
||||
</Show>
|
||||
|
||||
@@ -107,9 +107,9 @@ const TextNoteContentDisplay = (props: TextNoteContentDisplayProps) => {
|
||||
if (emojiUrl == null) return <span>{item.content}</span>;
|
||||
return (
|
||||
<img
|
||||
class="inline-block h-7 max-w-[64px] align-middle"
|
||||
class="inline-block h-8 max-w-[128px] align-middle"
|
||||
src={emojiUrl}
|
||||
alt={item.shortcode}
|
||||
alt={item.content}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { For, Switch, Match, type Component } from 'solid-js';
|
||||
import { For, Switch, Match, type Component, Show } from 'solid-js';
|
||||
|
||||
import { Kind, type Event as NostrEvent } from 'nostr-tools';
|
||||
|
||||
@@ -6,15 +6,19 @@ import ColumnItem from '@/components/ColumnItem';
|
||||
import Reaction from '@/components/event/Reaction';
|
||||
import Repost from '@/components/event/Repost';
|
||||
import TextNote from '@/components/event/TextNote';
|
||||
import useConfig from '@/core/useConfig';
|
||||
|
||||
export type NotificationProps = {
|
||||
events: NostrEvent[];
|
||||
};
|
||||
|
||||
const Notification: Component<NotificationProps> = (props) => {
|
||||
const { shouldMuteEvent } = useConfig();
|
||||
|
||||
return (
|
||||
<For each={props.events}>
|
||||
{(event) => (
|
||||
<Show when={!shouldMuteEvent(event)}>
|
||||
<Switch fallback={<div>unknown event</div>}>
|
||||
<Match when={event.kind === Kind.Text}>
|
||||
<ColumnItem>
|
||||
@@ -33,6 +37,7 @@ const Notification: Component<NotificationProps> = (props) => {
|
||||
</ColumnItem>
|
||||
</Match>
|
||||
</Switch>
|
||||
</Show>
|
||||
)}
|
||||
</For>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export const isImageUrl = (urlString: string): boolean => {
|
||||
try {
|
||||
const url = new URL(urlString);
|
||||
return /\.(jpeg|jpg|png|gif|webp|apng)$/i.test(url.pathname);
|
||||
return /\.(jpeg|jpg|png|gif|webp|apng|svg)$/i.test(url.pathname);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user