diff --git a/.eslintrc b/.eslintrc index 0bdfcb44..0e9ed689 100644 --- a/.eslintrc +++ b/.eslintrc @@ -10,7 +10,8 @@ ], "rules": { "@typescript-eslint/no-unused-vars": "error", - "@typescript-eslint/no-explicit-any": "warn" + "@typescript-eslint/no-explicit-any": "warn", + "react/no-unknown-property": ["error", { "ignore": ["fetchpriority"] }] }, "ignorePatterns": ["dist", "**/*.js", "**/*.json", "node_modules"] } diff --git a/global.d.ts b/global.d.ts new file mode 100644 index 00000000..94a6189c --- /dev/null +++ b/global.d.ts @@ -0,0 +1,7 @@ +import { AriaAttributes, DOMAttributes } from 'react'; + +declare module 'react' { + interface HTMLAttributes extends AriaAttributes, DOMAttributes { + fetchpriority?: 'high' | 'low' | 'auto'; + } +} diff --git a/src/components/channels/channelListItem.tsx b/src/components/channels/channelListItem.tsx index f734c9c7..4def5b79 100644 --- a/src/components/channels/channelListItem.tsx +++ b/src/components/channels/channelListItem.tsx @@ -25,6 +25,8 @@ export const ChannelListItem = ({ data }: { data: any }) => { src={channel?.picture || DEFAULT_AVATAR} alt={data.event_id} className="h-5 w-5 rounded bg-zinc-900 object-cover" + loading="lazy" + fetchpriority="high" />
diff --git a/src/components/chats/chatList.tsx b/src/components/chats/chatList.tsx index 532af110..7c64c906 100644 --- a/src/components/chats/chatList.tsx +++ b/src/components/chats/chatList.tsx @@ -30,6 +30,8 @@ export default function ChatList() { src={profile?.picture || DEFAULT_AVATAR} alt={activeAccount.pubkey} className="h-5 w-5 rounded object-cover" + loading="lazy" + fetchpriority="high" />
diff --git a/src/components/chats/chatListItem.tsx b/src/components/chats/chatListItem.tsx index 893dcca9..2b8c55ee 100644 --- a/src/components/chats/chatListItem.tsx +++ b/src/components/chats/chatListItem.tsx @@ -22,7 +22,13 @@ export const ChatListItem = ({ pubkey }: { pubkey: string }) => { )} >
- {pubkey} + {pubkey}
diff --git a/src/components/chats/messageUser.tsx b/src/components/chats/messageUser.tsx index 5b3a903a..1061b1c6 100644 --- a/src/components/chats/messageUser.tsx +++ b/src/components/chats/messageUser.tsx @@ -14,7 +14,13 @@ export const MessageUser = ({ pubkey, time }: { pubkey: string; time: number }) return (
- {pubkey} + {pubkey}
diff --git a/src/components/note/preview/image.tsx b/src/components/note/preview/image.tsx index 60327fd1..96742464 100644 --- a/src/components/note/preview/image.tsx +++ b/src/components/note/preview/image.tsx @@ -3,7 +3,7 @@ import { memo } from 'react'; export const ImagePreview = memo(function ImagePreview({ url, size }: { url: string; size: string }) { return (
- {url} + {url}
); }); diff --git a/src/components/user/base.tsx b/src/components/user/base.tsx index 9464bec2..d39e3467 100644 --- a/src/components/user/base.tsx +++ b/src/components/user/base.tsx @@ -11,7 +11,13 @@ export const UserBase = memo(function UserBase({ pubkey }: { pubkey: string }) { return (
- {pubkey} + {pubkey}
diff --git a/src/components/user/extend.tsx b/src/components/user/extend.tsx index 0311adcc..d676a050 100644 --- a/src/components/user/extend.tsx +++ b/src/components/user/extend.tsx @@ -14,7 +14,13 @@ export const UserExtend = ({ pubkey, time }: { pubkey: string; time: number }) = return (
- {pubkey} + {pubkey}
diff --git a/src/components/user/follow.tsx b/src/components/user/follow.tsx index 0b4337be..106481e9 100644 --- a/src/components/user/follow.tsx +++ b/src/components/user/follow.tsx @@ -9,7 +9,13 @@ export const UserFollow = ({ pubkey }: { pubkey: string }) => { return (
- {pubkey} + {pubkey}
diff --git a/src/components/user/large.tsx b/src/components/user/large.tsx index 3fd0ac80..77c320aa 100644 --- a/src/components/user/large.tsx +++ b/src/components/user/large.tsx @@ -19,6 +19,8 @@ export const UserLarge = ({ pubkey, time }: { pubkey: string; time: number }) => src={profile?.picture || DEFAULT_AVATAR} alt={pubkey} className="h-11 w-11 rounded-md border border-white/10 object-cover" + loading="lazy" + fetchpriority="high" />
diff --git a/src/components/user/mini.tsx b/src/components/user/mini.tsx index 5423f6a0..ead6ce69 100644 --- a/src/components/user/mini.tsx +++ b/src/components/user/mini.tsx @@ -9,7 +9,13 @@ export const UserMini = ({ pubkey }: { pubkey: string }) => { return (
- {pubkey} + {pubkey}
Replying to {profile?.name || shortenKey(pubkey)} diff --git a/src/components/user/quoteRepost.tsx b/src/components/user/quoteRepost.tsx index 956c7742..44b5a903 100644 --- a/src/components/user/quoteRepost.tsx +++ b/src/components/user/quoteRepost.tsx @@ -14,7 +14,13 @@ export const UserQuoteRepost = ({ pubkey, time }: { pubkey: string; time: number return (
- {pubkey} + {pubkey}
diff --git a/tsconfig.json b/tsconfig.json index 95493d99..85c31670 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,6 +30,6 @@ ], "strictNullChecks": false }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "include": ["global.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules"] }