|
|
|
@ -6,7 +6,7 @@ import {
@@ -6,7 +6,7 @@ import {
|
|
|
|
|
} from '@/shared/helpers' |
|
|
|
|
import { useTheme } from '@/shared/hooks' |
|
|
|
|
import { PartialTheme } from '@/shared/themes/interfaces' |
|
|
|
|
import _, { last } from 'lodash' |
|
|
|
|
import _ from 'lodash' |
|
|
|
|
import moment from 'moment' |
|
|
|
|
import React, { |
|
|
|
|
FC, |
|
|
|
@ -59,6 +59,7 @@ export const ChatMessages: FC<ChatMessagesProps> = ({ items, ...props }) => {
@@ -59,6 +59,7 @@ export const ChatMessages: FC<ChatMessagesProps> = ({ items, ...props }) => {
|
|
|
|
|
const [touchStart, setTouchStart] = useState(null) |
|
|
|
|
const [isScrolling, setScrolling] = useState(false) |
|
|
|
|
const [itemsHeight, setHeight] = useState({}) |
|
|
|
|
const [activeAudioId, setActiveAudioId] = useState<number>(null) |
|
|
|
|
|
|
|
|
|
const listRef = useRef(null) |
|
|
|
|
const itemsRef = useRef<IChatMessage[]>(null) |
|
|
|
@ -227,6 +228,8 @@ export const ChatMessages: FC<ChatMessagesProps> = ({ items, ...props }) => {
@@ -227,6 +228,8 @@ export const ChatMessages: FC<ChatMessagesProps> = ({ items, ...props }) => {
|
|
|
|
|
props.onProfilePress(item.authorId) |
|
|
|
|
}} |
|
|
|
|
onRepliedPress={props.onPressReplied} |
|
|
|
|
onPressPlay={() => setActiveAudioId(item.id)} |
|
|
|
|
activeAudioId={activeAudioId} |
|
|
|
|
/> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
@ -255,7 +258,7 @@ export const ChatMessages: FC<ChatMessagesProps> = ({ items, ...props }) => {
@@ -255,7 +258,7 @@ export const ChatMessages: FC<ChatMessagesProps> = ({ items, ...props }) => {
|
|
|
|
|
|
|
|
|
|
return null |
|
|
|
|
}, |
|
|
|
|
[items], |
|
|
|
|
[items, activeAudioId], |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
const calculateOffset = (index: number) => { |
|
|
|
|