mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 10:31:35 +00:00
Small fixes. Click through laoding overlay, take amount calc with no api/info.
This commit is contained in:
parent
a0627a2028
commit
275a68a7f0
@ -35,9 +35,9 @@ const OrderPage = (): JSX.Element => {
|
||||
const [tab, setTab] = useState<'order' | 'contract'>('contract');
|
||||
|
||||
useEffect(() => {
|
||||
setCurrentOrder(Number(params.orderId));
|
||||
if (currentOrder != params.orderId) {
|
||||
clearOrder();
|
||||
setCurrentOrder(Number(params.orderId));
|
||||
}
|
||||
}, [params.orderId]);
|
||||
|
||||
|
@ -16,7 +16,6 @@ import {
|
||||
import { Bolt, Add, DeleteSweep, Logout, Download } from '@mui/icons-material';
|
||||
import RobotAvatar from '../../components/RobotAvatar';
|
||||
import TokenInput from './TokenInput';
|
||||
import { Page } from '../NavBar';
|
||||
import { Slot, Robot } from '../../models';
|
||||
import { AppContext, UseAppStoreType } from '../../contexts/AppContext';
|
||||
import { genBase62Token } from '../../utils';
|
||||
@ -156,7 +155,6 @@ const RobotProfile = ({
|
||||
<Button
|
||||
onClick={() => {
|
||||
navigate(`/order/${robot.activeOrderId}`);
|
||||
setCurrentOrder(robot.activeOrderId);
|
||||
}}
|
||||
>
|
||||
{t('Active order #{{orderID}}', { orderID: robot.activeOrderId })}
|
||||
@ -170,7 +168,6 @@ const RobotProfile = ({
|
||||
<Button
|
||||
onClick={() => {
|
||||
navigate(`/order/${robot.lastOrderId}`);
|
||||
setCurrentOrder(robot.lastOrderId);
|
||||
}}
|
||||
>
|
||||
{t('Last order #{{orderID}}', { orderID: robot.lastOrderId })}
|
||||
|
@ -15,6 +15,7 @@ import {
|
||||
IconButton,
|
||||
Tooltip,
|
||||
LinearProgressProps,
|
||||
styled,
|
||||
} from '@mui/material';
|
||||
import {
|
||||
DataGrid,
|
||||
@ -35,6 +36,12 @@ import RobotAvatar from '../RobotAvatar';
|
||||
import { Fullscreen, FullscreenExit, Refresh } from '@mui/icons-material';
|
||||
import { AppContext, UseAppStoreType } from '../../contexts/AppContext';
|
||||
|
||||
const ClickThroughDataGrid = styled(DataGrid)({
|
||||
'& .MuiDataGrid-overlayWrapperInner': {
|
||||
pointerEvents: 'none',
|
||||
},
|
||||
});
|
||||
|
||||
interface BookTableProps {
|
||||
orderList?: PublicOrder[];
|
||||
maxWidth: number;
|
||||
@ -741,7 +748,7 @@ const BookTable = ({
|
||||
: { width: `${width}em`, height: `${height}em`, overflow: 'auto' }
|
||||
}
|
||||
>
|
||||
<DataGrid
|
||||
<ClickThroughDataGrid
|
||||
localeText={localeText}
|
||||
rowHeight={3.714 * theme.typography.fontSize}
|
||||
headerHeight={3.25 * theme.typography.fontSize}
|
||||
@ -776,7 +783,7 @@ const BookTable = ({
|
||||
return (
|
||||
<Dialog open={fullscreen} fullScreen={true}>
|
||||
<Paper style={{ width: '100%', height: '100%', overflow: 'auto' }}>
|
||||
<DataGrid
|
||||
<ClickThroughDataGrid
|
||||
localeText={localeText}
|
||||
rowHeight={3.714 * theme.typography.fontSize}
|
||||
headerHeight={3.25 * theme.typography.fontSize}
|
||||
|
@ -51,7 +51,7 @@ const TakeButton = ({ order, setOrder, baseUrl, hasRobot, info }: TakeButtonProp
|
||||
const [satoshis, setSatoshis] = useState<string>('');
|
||||
|
||||
const satoshisNow = () => {
|
||||
const tradeFee = info.taker_fee;
|
||||
const tradeFee = info?.taker_fee ?? 0;
|
||||
const defaultRoutingBudget = 0.001;
|
||||
const btc_now = order.satoshis_now / 100000000;
|
||||
const rate = order.amount ? order.amount / btc_now : order.max_amount / btc_now;
|
||||
@ -67,7 +67,7 @@ const TakeButton = ({ order, setOrder, baseUrl, hasRobot, info }: TakeButtonProp
|
||||
|
||||
useEffect(() => {
|
||||
setSatoshis(satoshisNow());
|
||||
}, [order.satoshis_now, takeAmount]);
|
||||
}, [order.satoshis_now, takeAmount, info]);
|
||||
|
||||
const currencyCode: string = order.currency == 1000 ? 'Sats' : currencies[`${order.currency}`];
|
||||
|
||||
|
@ -149,7 +149,7 @@ const OrderDetails = ({
|
||||
let sats: string = '';
|
||||
|
||||
const isBuyer = (order.type == 0 && order.is_maker) || (order.type == 1 && !order.is_maker);
|
||||
const tradeFee = order.is_maker ? info.maker_fee : info.taker_fee;
|
||||
const tradeFee = order.is_maker ? info?.maker_fee ?? 0 : info?.taker_fee ?? 0;
|
||||
const defaultRoutingBudget = 0.001;
|
||||
const btc_now = order.satoshis_now / 100000000;
|
||||
const rate = order.amount ? order.amount / btc_now : order.max_amount / btc_now;
|
||||
|
Loading…
Reference in New Issue
Block a user