Skip to content

Commit

Permalink
chore: updated with latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
nada-deriv committed Sep 12, 2024
2 parents a8e08b3 + 077894b commit d74fd0c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 10 deletions.
26 changes: 20 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@babel/preset-env": "^7.24.5",
"@chakra-ui/react": "^2.8.2",
"@deriv-com/analytics": "^1.10.1",
"@deriv-com/analytics": "^1.16.1",
"@deriv-com/api-hooks": "^1.4.9",
"@deriv-com/translations": "^1.3.7",
"@deriv-com/ui": "^1.29.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ type TChatMessageTextProps = {

const ChatMessageText = ({ children, color, type = '' }: PropsWithChildren<TChatMessageTextProps>) => {
const { isDesktop } = useDevice();
const isAdmin = type === 'admin';

return (
<div className='chat-message-text'>
<Text color={color} lineHeight='xl' size={type === 'admin' && isDesktop ? 'xs' : 'sm'}>
<Text color={color} lineHeight={isAdmin ? 'lg' : 'xl'} size={isAdmin && isDesktop ? 'xs' : 'sm'}>
{children}
</Text>
</div>
Expand Down
11 changes: 11 additions & 0 deletions src/pages/orders/components/ChatMessages/ChatMessages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
@include mobile-or-tablet-screen {
height: 100%;
}

&__date {
margin-top: 1.6rem;
text-align: center;
}

&__item {
display: flex;
flex-direction: column;
Expand All @@ -26,6 +28,7 @@
&__file {
color: inherit;
}

&__image {
width: 50%;

Expand All @@ -40,6 +43,7 @@
}
}
}

&__pdf {
background-color: #ffffff;
border-radius: 0.8rem;
Expand All @@ -48,11 +52,13 @@
align-items: center;
gap: 1rem;
margin-bottom: 0.4rem;

a {
color: #999999;
text-decoration: none;
}
}

&__timestamp {
align-items: center;
display: flex;
Expand All @@ -67,6 +73,7 @@
border-bottom-left-radius: 0;
}
}

&__outgoing {
align-items: flex-end;

Expand All @@ -82,6 +89,10 @@
border: 1px solid #ffad3a;
padding: 0.8rem 0;
border-radius: 0.8rem;

&--text {
margin-bottom: 1rem;
}
}
}
}
11 changes: 10 additions & 1 deletion src/pages/orders/components/ChatMessages/ChatMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,16 @@ type TChatMessagesProps = {
const AdminMessage = () => (
<div className='chat-messages__item chat-messages__item__admin'>
<ChatMessageText color='general' type='admin'>
<Localize i18n_default_text='Hello! This is where you can chat with the counterparty to confirm the order details.<br /> Note: In case of a dispute, we’ll use this chat as a reference.' />
<div className='chat-messages__item__admin--text'>
<Localize
components={[<strong key={0} />]}
i18n_default_text='<0>Important:</0> Deriv will never contact you via WhatsApp to ask for your personal information. Always ignore any messages from numbers claiming to be from Deriv.'
/>
</div>
<Localize
components={[<strong key={0} />]}
i18n_default_text="<0>Note:</0> In case of a dispute, we'll use this chat as a reference."
/>
</ChatMessageText>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ describe('ChatMessages', () => {
it('should render the messages as expected', () => {
render(<ChatMessages {...mockProps} />);
expect(
screen.getByText(/Hello! This is where you can chat with the counterparty to confirm the order details./)
screen.getByText(
/Deriv will never contact you via WhatsApp to ask for your personal information. Always ignore any messages from numbers claiming to be from Deriv./
)
).toBeInTheDocument();
});
it('should display the message sent by the user', () => {
Expand Down

0 comments on commit d74fd0c

Please sign in to comment.