mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-19 04:31:35 +00:00
Fix chat avatars and numeric displays
This commit is contained in:
parent
d380925c52
commit
0d9dbe5962
@ -29,6 +29,8 @@ interface Props {
|
|||||||
status: number;
|
status: number;
|
||||||
userNick: string;
|
userNick: string;
|
||||||
takerNick: string;
|
takerNick: string;
|
||||||
|
takerHashId: string;
|
||||||
|
makerHashId: string;
|
||||||
messages: EncryptedChatMessage[];
|
messages: EncryptedChatMessage[];
|
||||||
setMessages: (messages: EncryptedChatMessage[]) => void;
|
setMessages: (messages: EncryptedChatMessage[]) => void;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
@ -41,6 +43,8 @@ const EncryptedSocketChat: React.FC<Props> = ({
|
|||||||
status,
|
status,
|
||||||
userNick,
|
userNick,
|
||||||
takerNick,
|
takerNick,
|
||||||
|
makerHashId,
|
||||||
|
takerHashId,
|
||||||
messages,
|
messages,
|
||||||
setMessages,
|
setMessages,
|
||||||
baseUrl,
|
baseUrl,
|
||||||
@ -315,7 +319,9 @@ const EncryptedSocketChat: React.FC<Props> = ({
|
|||||||
message={message}
|
message={message}
|
||||||
isTaker={isTaker}
|
isTaker={isTaker}
|
||||||
userConnected={userConnected}
|
userConnected={userConnected}
|
||||||
baseUrl={baseUrl}
|
takerNick={takerNick}
|
||||||
|
takerHashId={takerHashId}
|
||||||
|
makerHashId={makerHashId}
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
@ -25,6 +25,8 @@ interface Props {
|
|||||||
order: Order;
|
order: Order;
|
||||||
userNick: string;
|
userNick: string;
|
||||||
takerNick: string;
|
takerNick: string;
|
||||||
|
takerHashId: string;
|
||||||
|
makerHashId: string;
|
||||||
chatOffset: number;
|
chatOffset: number;
|
||||||
messages: EncryptedChatMessage[];
|
messages: EncryptedChatMessage[];
|
||||||
setMessages: (messages: EncryptedChatMessage[]) => void;
|
setMessages: (messages: EncryptedChatMessage[]) => void;
|
||||||
@ -42,6 +44,8 @@ const EncryptedTurtleChat: React.FC<Props> = ({
|
|||||||
order,
|
order,
|
||||||
userNick,
|
userNick,
|
||||||
takerNick,
|
takerNick,
|
||||||
|
takerHashId,
|
||||||
|
makerHashId,
|
||||||
chatOffset,
|
chatOffset,
|
||||||
messages,
|
messages,
|
||||||
setMessages,
|
setMessages,
|
||||||
@ -311,7 +315,9 @@ const EncryptedTurtleChat: React.FC<Props> = ({
|
|||||||
message={message}
|
message={message}
|
||||||
isTaker={isTaker}
|
isTaker={isTaker}
|
||||||
userConnected={userConnected}
|
userConnected={userConnected}
|
||||||
baseUrl={baseUrl}
|
takerNick={takerNick}
|
||||||
|
takerHashId={takerHashId}
|
||||||
|
makerHashId={makerHashId}
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
|
@ -13,12 +13,21 @@ import { type EncryptedChatMessage } from '..';
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
message: EncryptedChatMessage;
|
message: EncryptedChatMessage;
|
||||||
|
takerNick: string;
|
||||||
|
takerHashId: string;
|
||||||
|
makerHashId: string;
|
||||||
isTaker: boolean;
|
isTaker: boolean;
|
||||||
userConnected: boolean;
|
userConnected: boolean;
|
||||||
baseUrl: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const MessageCard: React.FC<Props> = ({ message, isTaker, userConnected, baseUrl }) => {
|
const MessageCard: React.FC<Props> = ({
|
||||||
|
message,
|
||||||
|
isTaker,
|
||||||
|
userConnected,
|
||||||
|
takerNick,
|
||||||
|
takerHashId,
|
||||||
|
makerHashId,
|
||||||
|
}) => {
|
||||||
const [showPGP, setShowPGP] = useState<boolean>(false);
|
const [showPGP, setShowPGP] = useState<boolean>(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@ -34,8 +43,7 @@ const MessageCard: React.FC<Props> = ({ message, isTaker, userConnected, baseUrl
|
|||||||
avatar={
|
avatar={
|
||||||
<RobotAvatar
|
<RobotAvatar
|
||||||
statusColor={userConnected ? 'success' : 'error'}
|
statusColor={userConnected ? 'success' : 'error'}
|
||||||
nickname={message.userNick}
|
hashId={message.userNick === takerNick ? takerHashId : makerHashId}
|
||||||
baseUrl={baseUrl}
|
|
||||||
small={true}
|
small={true}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
@ -6,9 +6,6 @@ import EncryptedTurtleChat from './EncryptedTurtleChat';
|
|||||||
interface Props {
|
interface Props {
|
||||||
order: Order;
|
order: Order;
|
||||||
status: number;
|
status: number;
|
||||||
takerNick: string;
|
|
||||||
makerNick: string;
|
|
||||||
userNick: string;
|
|
||||||
chatOffset: number;
|
chatOffset: number;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
messages: EncryptedChatMessage[];
|
messages: EncryptedChatMessage[];
|
||||||
@ -34,8 +31,6 @@ export interface ServerMessage {
|
|||||||
|
|
||||||
const EncryptedChat: React.FC<Props> = ({
|
const EncryptedChat: React.FC<Props> = ({
|
||||||
order,
|
order,
|
||||||
takerNick,
|
|
||||||
userNick,
|
|
||||||
chatOffset,
|
chatOffset,
|
||||||
baseUrl,
|
baseUrl,
|
||||||
setMessages,
|
setMessages,
|
||||||
@ -49,8 +44,10 @@ const EncryptedChat: React.FC<Props> = ({
|
|||||||
messages={messages}
|
messages={messages}
|
||||||
setMessages={setMessages}
|
setMessages={setMessages}
|
||||||
order={order}
|
order={order}
|
||||||
takerNick={takerNick}
|
takerNick={order.taker_nick}
|
||||||
userNick={userNick}
|
takerHashId={order.taker_hash_id}
|
||||||
|
makerHashId={order.maker_hash_id}
|
||||||
|
userNick={order.ur_nick}
|
||||||
chatOffset={chatOffset}
|
chatOffset={chatOffset}
|
||||||
baseUrl={baseUrl}
|
baseUrl={baseUrl}
|
||||||
turtleMode={turtleMode}
|
turtleMode={turtleMode}
|
||||||
@ -62,8 +59,10 @@ const EncryptedChat: React.FC<Props> = ({
|
|||||||
messages={messages}
|
messages={messages}
|
||||||
setMessages={setMessages}
|
setMessages={setMessages}
|
||||||
order={order}
|
order={order}
|
||||||
takerNick={takerNick}
|
takerNick={order.taker_nick}
|
||||||
userNick={userNick}
|
takerHashId={order.taker_hash_id}
|
||||||
|
makerHashId={order.maker_hash_id}
|
||||||
|
userNick={order.ur_nick}
|
||||||
baseUrl={baseUrl}
|
baseUrl={baseUrl}
|
||||||
turtleMode={turtleMode}
|
turtleMode={turtleMode}
|
||||||
setTurtleMode={setTurtleMode}
|
setTurtleMode={setTurtleMode}
|
||||||
|
@ -50,7 +50,9 @@ export const ChatPrompt = ({
|
|||||||
const [text, setText] = useState<string>('');
|
const [text, setText] = useState<string>('');
|
||||||
|
|
||||||
const currencyCode: string = currencies[`${order.currency}`];
|
const currencyCode: string = currencies[`${order.currency}`];
|
||||||
const amount: string = pn(parseFloat(order.amount ?? 0).toFixed(order.currency === 1000 ? 8 : 4));
|
const amount: string = pn(
|
||||||
|
Number(parseFloat(order.amount ?? 0).toFixed(order.currency === 1000 ? 8 : 4)),
|
||||||
|
);
|
||||||
|
|
||||||
const disputeCountdownRenderer = function ({
|
const disputeCountdownRenderer = function ({
|
||||||
hours,
|
hours,
|
||||||
@ -133,9 +135,6 @@ export const ChatPrompt = ({
|
|||||||
status={order.status}
|
status={order.status}
|
||||||
chatOffset={order.chat_last_index}
|
chatOffset={order.chat_last_index}
|
||||||
order={order}
|
order={order}
|
||||||
takerNick={order.taker_nick}
|
|
||||||
makerNick={order.maker_nick}
|
|
||||||
userNick={order.ur_nick}
|
|
||||||
baseUrl={baseUrl}
|
baseUrl={baseUrl}
|
||||||
messages={messages}
|
messages={messages}
|
||||||
setMessages={setMessages}
|
setMessages={setMessages}
|
||||||
|
Loading…
Reference in New Issue
Block a user