update,
This commit is contained in:
@@ -77,12 +77,12 @@ const Chat = () => {
|
|||||||
const [toastMessage, setToastMessage] = useState("");
|
const [toastMessage, setToastMessage] = useState("");
|
||||||
|
|
||||||
// Refs
|
// Refs
|
||||||
const contentRef = useRef();
|
const contentRef = useRef(null);
|
||||||
const swiperRefs = useRef([]);
|
const swiperRefs = useRef([]);
|
||||||
const textareaRef = useRef();
|
const textareaRef = useRef(null);
|
||||||
const sideRef = useRef();
|
const sideRef = useRef(null);
|
||||||
const sendRef = useRef();
|
const sendRef = useRef(null);
|
||||||
const replyToAnimationRef = useRef();
|
const replyToAnimationRef = useRef(null);
|
||||||
|
|
||||||
const actionSheetButtons = [
|
const actionSheetButtons = [
|
||||||
{
|
{
|
||||||
@@ -104,7 +104,7 @@ const Chat = () => {
|
|||||||
icon: alertOutline,
|
icon: alertOutline,
|
||||||
handler: () =>
|
handler: () =>
|
||||||
toaster(
|
toaster(
|
||||||
"I haven't implemented unsend :) Simple store update though",
|
"I haven't implemented unsend :) Simple store update though"
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -169,7 +169,7 @@ const Chat = () => {
|
|||||||
: parseInt(elementID.replace("chatBubble_", ""));
|
: parseInt(elementID.replace("chatBubble_", ""));
|
||||||
|
|
||||||
const chatMessage = chat.filter(
|
const chatMessage = chat.filter(
|
||||||
(message) => parseInt(message.id) === parseInt(chatMessageID),
|
(message) => parseInt(message.id) === parseInt(chatMessageID)
|
||||||
)[0];
|
)[0];
|
||||||
|
|
||||||
setActionMessage(chatMessage);
|
setActionMessage(chatMessage);
|
||||||
@@ -278,7 +278,7 @@ const Chat = () => {
|
|||||||
replyToMessage,
|
replyToMessage,
|
||||||
replyToMessage ? replyToMessage.id : false,
|
replyToMessage ? replyToMessage.id : false,
|
||||||
image,
|
image,
|
||||||
imagePath,
|
imagePath
|
||||||
);
|
);
|
||||||
setMessage("");
|
setMessage("");
|
||||||
|
|
||||||
@@ -329,7 +329,7 @@ const Chat = () => {
|
|||||||
fill="clear"
|
fill="clear"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
toaster(
|
toaster(
|
||||||
"As this is a UI only, video calling wouldn't work here.",
|
"As this is a UI only, video calling wouldn't work here."
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -352,7 +352,7 @@ const Chat = () => {
|
|||||||
{chat.map((message, index) => {
|
{chat.map((message, index) => {
|
||||||
const repliedMessage = chat.filter(
|
const repliedMessage = chat.filter(
|
||||||
(subMessage) =>
|
(subMessage) =>
|
||||||
parseInt(subMessage.id) === parseInt(message.replyID),
|
parseInt(subMessage.id) === parseInt(message.replyID)
|
||||||
)[0];
|
)[0];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -360,7 +360,9 @@ const Chat = () => {
|
|||||||
ref={(ref) => (swiperRefs.current[index] = ref)}
|
ref={(ref) => (swiperRefs.current[index] = ref)}
|
||||||
id={`chatBubble_${message.id}`}
|
id={`chatBubble_${message.id}`}
|
||||||
key={index}
|
key={index}
|
||||||
className={`chat-bubble ${message.sent ? "bubble-sent" : "bubble-received"}`}
|
className={`chat-bubble ${
|
||||||
|
message.sent ? "bubble-sent" : "bubble-received"
|
||||||
|
}`}
|
||||||
{...longPressEvent}
|
{...longPressEvent}
|
||||||
>
|
>
|
||||||
<div id={`chatText_${message.id}`}>
|
<div id={`chatText_${message.id}`}>
|
||||||
|
@@ -22,7 +22,7 @@ import { useRef } from "react";
|
|||||||
import ContactModal from "../components/ContactModal";
|
import ContactModal from "../components/ContactModal";
|
||||||
|
|
||||||
const Chats = () => {
|
const Chats = () => {
|
||||||
const pageRef = useRef();
|
const pageRef = useRef(null);
|
||||||
const contacts = ContactStore.useState(getContacts);
|
const contacts = ContactStore.useState(getContacts);
|
||||||
const latestChats = ChatStore.useState(getChats);
|
const latestChats = ChatStore.useState(getChats);
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ const Chats = () => {
|
|||||||
contacts
|
contacts
|
||||||
.filter((c) => c.id === chat.contact_id)[0]
|
.filter((c) => c.id === chat.contact_id)[0]
|
||||||
.name.toLowerCase()
|
.name.toLowerCase()
|
||||||
.includes(searchTermLower),
|
.includes(searchTermLower)
|
||||||
);
|
);
|
||||||
setResults(newResults);
|
setResults(newResults);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user