Small fixes

This commit is contained in:
Reckless_Satoshi 2022-10-20 10:35:49 -07:00
parent 23d6c00ccb
commit 9c6d55cfc7
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 58 additions and 57 deletions

View File

@ -117,7 +117,6 @@ const Main = (): JSX.Element => {
});
};
console.log(robot);
return (
<Router basename={basename}>
<div className='appCenter'>

View File

@ -208,60 +208,62 @@ const DepthChart: React.FC<DepthChartProps> = ({
/>
);
const generateTooltip: React.FunctionComponent<PointTooltipProps> = (
pointTooltip: PointTooltipProps,
) => {
const order: Order = pointTooltip.point.data.order;
return order ? (
<Paper elevation={12} style={{ padding: 10, width: 250 }}>
<Grid container justifyContent='space-between'>
<Grid item xs={3}>
<Grid container justifyContent='center' alignItems='center'>
<RobotAvatar
nickname={order.maker_nick}
orderType={order.type}
statusColor={statusBadgeColor(order.maker_status)}
tooltip={t(order.maker_status)}
/>
</Grid>
</Grid>
<Grid item xs={8}>
<Grid container direction='column' justifyContent='center' alignItems='flex-start'>
<Box>{order.maker_nick}</Box>
<Box>
<Grid
container
direction='column'
justifyContent='flex-start'
alignItems='flex-start'
>
<Grid item xs={12}>
{amountToString(
order.amount,
order.has_range,
order.min_amount,
order.max_amount,
)}{' '}
{currencyDict[order.currency]}
</Grid>
<Grid item xs={12}>
<PaymentStringAsIcons
othersText={t('Others')}
verbose={true}
size={20}
text={order.payment_method}
/>
</Grid>
</Grid>
</Box>
</Grid>
</Grid>
</Grid>
</Paper>
) : (
<></>
);
};
// Unkown Bug. Temporarily silenced until cause is found.
// const generateTooltip: React.FunctionComponent<PointTooltipProps> = (
// pointTooltip: PointTooltipProps,
// ) => {
// const order: Order = pointTooltip.point.data.order;
// return order ? (
// <Paper elevation={12} style={{ padding: 10, width: 250 }}>
// <Grid container justifyContent='space-between'>
// <Grid item xs={3}>
// <Grid container justifyContent='center' alignItems='center'>
// <RobotAvatar
// nickname={order.maker_nick}
// orderType={order.type}
// statusColor={statusBadgeColor(order.maker_status)}
// tooltip={t(order.maker_status)}
// />
// </Grid>
// </Grid>
// <Grid item xs={8}>
// <Grid container direction='column' justifyContent='center' alignItems='flex-start'>
// <Box>{order.maker_nick}</Box>
// <Box>
// <Grid
// container
// direction='column'
// justifyContent='flex-start'
// alignItems='flex-start'
// >
// <Grid item xs={12}>
// {amountToString(
// order.amount,
// order.has_range,
// order.min_amount,
// order.max_amount,
// )}{' '}
// {currencyDict[order.currency]}
// </Grid>
// <Grid item xs={12}>
// <PaymentStringAsIcons
// othersText={t('Others')}
// verbose={true}
// size={20}
// text={order.payment_method}
// />
// </Grid>
// </Grid>
// </Box>
// </Grid>
// </Grid>
// </Grid>
// </Paper>
// ) : (
// <></>
// );
// };
const formatAxisX = (value: number): string => {
if (xType === 'base_amount') {
@ -345,7 +347,7 @@ const DepthChart: React.FC<DepthChartProps> = ({
useMesh={true}
animate={false}
crosshairType='cross'
tooltip={generateTooltip}
// tooltip={generateTooltip}
onClick={handleOnClick}
axisRight={{
tickSize: 5,

View File

@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { useAutocomplete } from '@mui/base/AutocompleteUnstyled';
import { styled } from '@mui/material/styles';
import { Button, Fade, Tooltip, Typography, Grow } from '@mui/material';
import { fiatMethods, swapMethods , PaymentIcon } from '../PaymentMethods';
import { fiatMethods, swapMethods, PaymentIcon } from '../PaymentMethods';
// Icons
import DashboardCustomizeIcon from '@mui/icons-material/DashboardCustomize';