Optimize notifications rendering (#1957)
parent
d1c14940fb
commit
7c51a3931a
|
@ -1,4 +1,4 @@
|
||||||
import React, {useMemo, useState, useEffect} from 'react'
|
import React, {memo, useMemo, useState, useEffect} from 'react'
|
||||||
import {
|
import {
|
||||||
Animated,
|
Animated,
|
||||||
TouchableOpacity,
|
TouchableOpacity,
|
||||||
|
@ -56,7 +56,7 @@ interface Author {
|
||||||
moderation: ProfileModeration
|
moderation: ProfileModeration
|
||||||
}
|
}
|
||||||
|
|
||||||
export function FeedItem({
|
let FeedItem = ({
|
||||||
item,
|
item,
|
||||||
dataUpdatedAt,
|
dataUpdatedAt,
|
||||||
moderationOpts,
|
moderationOpts,
|
||||||
|
@ -64,7 +64,7 @@ export function FeedItem({
|
||||||
item: FeedNotification
|
item: FeedNotification
|
||||||
dataUpdatedAt: number
|
dataUpdatedAt: number
|
||||||
moderationOpts: ModerationOpts
|
moderationOpts: ModerationOpts
|
||||||
}) {
|
}): React.ReactNode => {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const [isAuthorsExpanded, setAuthorsExpanded] = useState<boolean>(false)
|
const [isAuthorsExpanded, setAuthorsExpanded] = useState<boolean>(false)
|
||||||
const itemHref = useMemo(() => {
|
const itemHref = useMemo(() => {
|
||||||
|
@ -262,6 +262,8 @@ export function FeedItem({
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
FeedItem = memo(FeedItem)
|
||||||
|
export {FeedItem}
|
||||||
|
|
||||||
function ExpandListPressable({
|
function ExpandListPressable({
|
||||||
hasMultipleAuthors,
|
hasMultipleAuthors,
|
||||||
|
|
Loading…
Reference in New Issue