fix
This commit is contained in:
parent
c5002e1a7a
commit
f3872e7ce1
@ -10,5 +10,4 @@
|
||||
align-self: flex-end;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,20 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import clsx from "clsx";
|
||||
import { useEffect } from "react";
|
||||
import clsx from "clsx";
|
||||
|
||||
import type { IChatMessage } from "@/entities/chats/types";
|
||||
import { useShowRefillModal } from "@/hooks/refill/useShowRefillModal";
|
||||
import { useChat } from "@/providers/chat-provider";
|
||||
import { formatTime } from "@/shared/utils/date";
|
||||
|
||||
import styles from "./ChatMessage.module.scss";
|
||||
import MessageBubble from "./MessageBubble/MessageBubble";
|
||||
import MessageMeta from "./MessageMeta/MessageMeta";
|
||||
import MessageStatus from "./MessageStatus/MessageStatus";
|
||||
import MessageText from "./MessageText/MessageText";
|
||||
import MessageTyping from "./MessageTyping/MessageTyping";
|
||||
|
||||
import styles from "./ChatMessage.module.scss";
|
||||
|
||||
export interface ChatMessageProps {
|
||||
// message: {
|
||||
// id: string;
|
||||
|
||||
@ -10,7 +10,9 @@
|
||||
&.blurred {
|
||||
filter: blur(4px);
|
||||
opacity: 0.6;
|
||||
transition: filter 0.3s ease, opacity 0.3s ease;
|
||||
transition:
|
||||
filter 0.3s ease,
|
||||
opacity 0.3s ease;
|
||||
pointer-events: none;
|
||||
user-select: none; // Запрещаем выделение текста
|
||||
-webkit-user-select: none; // Safari
|
||||
|
||||
@ -28,7 +28,7 @@ export default function MessageText({
|
||||
return (
|
||||
<div
|
||||
onClick={handleClick}
|
||||
style={isBlurred ? { cursor: 'pointer' } : undefined}
|
||||
style={isBlurred ? { cursor: "pointer" } : undefined}
|
||||
>
|
||||
<Typography
|
||||
as="p"
|
||||
|
||||
@ -81,7 +81,9 @@ export default function ChatModalsWrapper() {
|
||||
return (
|
||||
<ModalSheet
|
||||
open={isModalOpen}
|
||||
onClose={modalChild === "refill-timer" ? handleTimerModalClose : handleModalClose}
|
||||
onClose={
|
||||
modalChild === "refill-timer" ? handleTimerModalClose : handleModalClose
|
||||
}
|
||||
variant={modalChild === "refill-timer" ? "gray" : "white"}
|
||||
disableBackdropClose={true}
|
||||
>
|
||||
|
||||
@ -41,7 +41,11 @@ export default function GlobalNewMessagesBanner() {
|
||||
onClick={() => setHomeNewMessages({ isVisibleAll: !isVisibleAll })}
|
||||
/>
|
||||
)}
|
||||
<NewMessages chats={unreadChats} isVisibleAll={isVisibleAll} currentBalance={balance} />
|
||||
<NewMessages
|
||||
chats={unreadChats}
|
||||
isVisibleAll={isVisibleAll}
|
||||
currentBalance={balance}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@ -21,7 +21,9 @@
|
||||
&.blurred {
|
||||
filter: blur(4px);
|
||||
opacity: 0.6;
|
||||
transition: filter 0.3s ease, opacity 0.3s ease;
|
||||
transition:
|
||||
filter 0.3s ease,
|
||||
opacity 0.3s ease;
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
|
||||
@ -25,8 +25,7 @@ export default function LastMessagePreview({
|
||||
|
||||
// Определяем нужно ли блюрить сообщение
|
||||
const shouldBlur =
|
||||
message.sentWithZeroBalance === true &&
|
||||
currentBalance <= 0;
|
||||
message.sentWithZeroBalance === true && currentBalance <= 0;
|
||||
|
||||
const getMessageIcon = () => {
|
||||
switch (message.type) {
|
||||
@ -80,7 +79,7 @@ export default function LastMessagePreview({
|
||||
size="sm"
|
||||
color="secondary"
|
||||
align="left"
|
||||
className={`${styles.text} ${shouldBlur ? styles.blurred : ''}`}
|
||||
className={`${styles.text} ${shouldBlur ? styles.blurred : ""}`}
|
||||
>
|
||||
{getMessageText()}
|
||||
</Typography>
|
||||
|
||||
@ -12,7 +12,10 @@ interface MessageInputProps {
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export default function MessageInput({ onSend, disabled = false }: MessageInputProps) {
|
||||
export default function MessageInput({
|
||||
onSend,
|
||||
disabled = false,
|
||||
}: MessageInputProps) {
|
||||
const t = useTranslations("Chat");
|
||||
const [message, setMessage] = useState("");
|
||||
|
||||
|
||||
@ -34,7 +34,11 @@ export default function NewMessagesWrapper() {
|
||||
}}
|
||||
isVisibleViewAll={unreadChats.length > 1}
|
||||
>
|
||||
<NewMessages chats={unreadChats} isVisibleAll={isVisibleAll} currentBalance={balance} />
|
||||
<NewMessages
|
||||
chats={unreadChats}
|
||||
isVisibleAll={isVisibleAll}
|
||||
currentBalance={balance}
|
||||
/>
|
||||
</ChatItemsList>
|
||||
)}
|
||||
</>
|
||||
|
||||
@ -31,7 +31,11 @@ export default function NewMessagesSection() {
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<NewMessages chats={unreadChats} isVisibleAll={isVisibleAll} currentBalance={balance} />
|
||||
<NewMessages
|
||||
chats={unreadChats}
|
||||
isVisibleAll={isVisibleAll}
|
||||
currentBalance={balance}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
|
||||
@ -39,7 +39,13 @@ export default function ModalSheet({
|
||||
return (
|
||||
<Modal
|
||||
open={open || isOpen}
|
||||
onClose={disableBackdropClose ? () => { /* Backdrop close disabled */ } : onClose}
|
||||
onClose={
|
||||
disableBackdropClose
|
||||
? () => {
|
||||
/* Backdrop close disabled */
|
||||
}
|
||||
: onClose
|
||||
}
|
||||
className={clsx(className, styles.overlay, {
|
||||
[styles.closed]: !open && isOpen,
|
||||
})}
|
||||
|
||||
@ -13,7 +13,7 @@ export const useBalance = () => {
|
||||
const { balance: apiBalance, isLoading } = useUserBalance();
|
||||
|
||||
// Слушаем обновления баланса через WebSocket
|
||||
useSocketEvent("balance_updated", (b) => {
|
||||
useSocketEvent("balance_updated", b => {
|
||||
setSocketBalance(b.data.balance);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user