-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed commit of the following: commit f60870f Author: Reckless_Satoshi <[email protected]> Date: Thu Nov 10 10:30:42 2022 -0800 Fix internal error when entering chat commit f1eeb49 Author: Reckless_Satoshi <[email protected]> Date: Tue Nov 8 10:08:22 2022 -0800 Fix final serializer commit d0c08ba Author: Reckless_Satoshi <[email protected]> Date: Tue Nov 8 09:44:57 2022 -0800 Chat API changes commit a66bf64 Author: Reckless_Satoshi <[email protected]> Date: Tue Nov 8 09:28:29 2022 -0800 Fix param on post commit 60b18d1 Author: Reckless_Satoshi <[email protected]> Date: Tue Nov 8 08:56:25 2022 -0800 Fix serializer commit 11212d3 Author: KoalaSat <[email protected]> Date: Sun Nov 6 21:07:18 2022 +0100 CR 2 commit c82790c Author: KoalaSat <[email protected]> Date: Sun Nov 6 20:09:18 2022 +0100 Fix commit 605a3b6 Author: KoalaSat <[email protected]> Date: Sun Nov 6 14:44:42 2022 +0100 CR commit 09776e9 Author: KoalaSat <[email protected]> Date: Wed Nov 2 18:12:29 2022 +0100 translations commit 432e4d2 Author: KoalaSat <[email protected]> Date: Wed Nov 2 17:39:02 2022 +0100 Switch and better UX commit df6e476 Author: KoalaSat <[email protected]> Date: Tue Nov 1 18:20:01 2022 +0100 Unused code commit 5b8d6b4 Author: Reckless_Satoshi <[email protected]> Date: Mon Oct 31 09:20:20 2022 -0700 Add Chat Turtle Mode
- Loading branch information
1 parent
160c24c
commit 3446fc3
Showing
14 changed files
with
994 additions
and
543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
frontend/src/components/TradeBox/EncryptedChat/ChatBottom/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React, { useState } from 'react'; | ||
import { Grid, useTheme, Tooltip, Button } from '@mui/material'; | ||
import { ExportIcon } from '../../../Icons'; | ||
import KeyIcon from '@mui/icons-material/Key'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { saveAsJson } from '../../../../utils'; | ||
|
||
interface Props { | ||
orderId: number; | ||
setAudit: (audit: boolean) => void; | ||
audit: boolean; | ||
createJsonFile: () => object; | ||
} | ||
|
||
const ChatBottom: React.FC<Props> = ({ orderId, setAudit, audit, createJsonFile }) => { | ||
const { t } = useTranslation(); | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<> | ||
<Grid item xs={6}> | ||
<Tooltip | ||
placement='bottom' | ||
enterTouchDelay={0} | ||
enterDelay={500} | ||
enterNextDelay={2000} | ||
title={t('Verify your privacy')} | ||
> | ||
<Button size='small' color='primary' variant='outlined' onClick={() => setAudit(!audit)}> | ||
<KeyIcon /> | ||
{t('Audit PGP')}{' '} | ||
</Button> | ||
</Tooltip> | ||
</Grid> | ||
|
||
<Grid item xs={6}> | ||
<Tooltip | ||
placement='bottom' | ||
enterTouchDelay={0} | ||
enterDelay={500} | ||
enterNextDelay={2000} | ||
title={t('Save full log as a JSON file (messages and credentials)')} | ||
> | ||
<Button | ||
size='small' | ||
color='primary' | ||
variant='outlined' | ||
onClick={() => saveAsJson('complete_log_chat_' + orderId + '.json', createJsonFile())} | ||
> | ||
<div style={{ width: '1.4em', height: '1.4em' }}> | ||
<ExportIcon sx={{ width: '0.8em', height: '0.8em' }} /> | ||
</div>{' '} | ||
{t('Export')}{' '} | ||
</Button> | ||
</Tooltip> | ||
</Grid> | ||
</> | ||
); | ||
}; | ||
|
||
export default ChatBottom; |
41 changes: 41 additions & 0 deletions
41
frontend/src/components/TradeBox/EncryptedChat/ChatHeader/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react'; | ||
import { Grid, Paper, Typography, useTheme } from '@mui/material'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
interface Props { | ||
connected: boolean; | ||
peerConnected: boolean; | ||
} | ||
|
||
const ChatHeader: React.FC<Props> = ({ connected, peerConnected }) => { | ||
const { t } = useTranslation(); | ||
const theme = useTheme(); | ||
const connectedColor = theme.palette.mode === 'light' ? '#b5e3b7' : '#153717'; | ||
const connectedTextColor = theme.palette.getContrastText(connectedColor); | ||
|
||
return ( | ||
<Grid container spacing={0.5}> | ||
<Grid item xs={0.3} /> | ||
<Grid item xs={5.5}> | ||
<Paper elevation={1} sx={connected ? { backgroundColor: connectedColor } : {}}> | ||
<Typography variant='caption' sx={{ color: connectedTextColor }}> | ||
{t('You') + ': '} | ||
{connected ? t('connected') : t('disconnected')} | ||
</Typography> | ||
</Paper> | ||
</Grid> | ||
<Grid item xs={0.4} /> | ||
<Grid item xs={5.5}> | ||
<Paper elevation={1} sx={peerConnected ? { backgroundColor: connectedColor } : {}}> | ||
<Typography variant='caption' sx={{ color: connectedTextColor }}> | ||
{t('Peer') + ': '} | ||
{peerConnected ? t('connected') : t('disconnected')} | ||
</Typography> | ||
</Paper> | ||
</Grid> | ||
<Grid item xs={0.3} /> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default ChatHeader; |
Oops, something went wrong.