Optimize notifications rendering (#1957)

zio/stable
dan 2023-11-17 17:51:44 +00:00 committed by GitHub
parent d1c14940fb
commit 7c51a3931a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import React, {useMemo, useState, useEffect} from 'react'
import React, {memo, useMemo, useState, useEffect} from 'react'
import {
Animated,
TouchableOpacity,
@ -56,7 +56,7 @@ interface Author {
moderation: ProfileModeration
}
export function FeedItem({
let FeedItem = ({
item,
dataUpdatedAt,
moderationOpts,
@ -64,7 +64,7 @@ export function FeedItem({
item: FeedNotification
dataUpdatedAt: number
moderationOpts: ModerationOpts
}) {
}): React.ReactNode => {
const pal = usePalette('default')
const [isAuthorsExpanded, setAuthorsExpanded] = useState<boolean>(false)
const itemHref = useMemo(() => {
@ -262,6 +262,8 @@ export function FeedItem({
</Link>
)
}
FeedItem = memo(FeedItem)
export {FeedItem}
function ExpandListPressable({
hasMultipleAuthors,