Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release / 5.2.200 #3582

Merged
merged 14 commits into from
Jul 15, 2024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion packages/yoroi-extension/app/components/swap/SwapInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function SwapInput({
component="fieldset"
sx={{
borderStyle: 'solid',
borderWidth: tokenInfo.id?.length > 0 && error ? '2px' : '1px',
borderWidth: (tokenInfo.id?.length > 0 && error) || focusState.value ? '2px' : '1px',
borderColor: error ? 'magenta.500' : isFocusedColor,
borderRadius: '8px',
p: '16px',
Expand All @@ -88,6 +88,7 @@ export default function SwapInput({
bgcolor: 'common.white',
columnGap: '6px',
rowGap: '8px',
maxHeight: '95px',
'&:hover': {
borderColor: !error && 'grayscale.max',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// @flow

import { Stack, Typography } from '@mui/material';
import { ReactComponent as NoCompleteOders } from '../../../assets/images/revamp/no-complete-orders.inline.svg';
import type { Node } from 'react';

const NoCompleteOrders = (): Node => {
return (
<Stack direction="column" justifyContent="center" alignItems="center" flex={1} pt="98px">
<NoCompleteOders />
<Typography variant="h4" fontWeight="500" color="ds.text_gray_normal" mt="52px" pb="8px">
No orders completed yet
</Typography>
</Stack>
);
};

export default NoCompleteOrders;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @flow

import { Stack, Typography } from '@mui/material';
import type { Node } from 'react';
import { ReactComponent as NoOpenOders } from '../../../assets/images/revamp/no-open-orders.inline.svg';

const NoOpenOrders = (): Node => {
return (
<Stack direction="column" justifyContent="center" alignItems="center" flex={1} pt="98px">
<NoOpenOders />
<Typography variant="h4" fontWeight="500" color="ds.text_gray_normal" mt="52px" pb="8px">
No orders available yet
</Typography>
<Typography variant="body1" color="ds.text_gray_medium" width="343px" textAlign="center">
Start doing the swap operations to see your open orders here
</Typography>
</Stack>
);
};

export default NoOpenOrders;
15 changes: 12 additions & 3 deletions packages/yoroi-extension/app/containers/swap/orders/OrdersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import type { CardanoConnectorSignRequest } from '../../../connector/types';
import { genLookupOrFail } from '../../../stores/stateless/tokenHelpers';
import moment from 'moment';
import { signTransactionHex } from '../../../api/ada/transactions/signTransactionHex';
import NoCompleteOrders from './NoCompleteOrders';
import NoOpenOrders from './NoOpenOrders';

type ColumnContext = {|
completedOrders: boolean,
Expand Down Expand Up @@ -378,8 +380,12 @@ export default function SwapOrdersPage(props: StoresAndActionsProps): Node {
.map(c => resolveValueOrGetter(c.width ?? 'auto', columnContext))
.join(' ');

const isDisplayOpenOrdersEmpty = !showCompletedOrders && openOrders?.length === 0;
const isDisplayCompletedOrdersEmpty = showCompletedOrders && completedOrders?.length === 0;
const safeColumnNames = isDisplayOpenOrdersEmpty || isDisplayCompletedOrdersEmpty ? [] : columnNames;

return (
<>
<Box sx={{ border: '1px solid transparent' }}>
<Box sx={{ mx: '24px' }}>
<Box sx={{ my: '24px' }}>
<Tabs
Expand All @@ -397,9 +403,10 @@ export default function SwapOrdersPage(props: StoresAndActionsProps): Node {
]}
/>
</Box>

<Table
columnKeys={columnKeys}
columnNames={columnNames}
columnNames={safeColumnNames}
columnAlignment={columnAlignment}
columnLeftPaddings={columnLeftPaddings}
gridTemplateColumns={gridTemplateColumns}
Expand Down Expand Up @@ -447,7 +454,9 @@ export default function SwapOrdersPage(props: StoresAndActionsProps): Node {
hwWalletError={null}
/>
)}
</>
{isDisplayOpenOrdersEmpty && <NoOpenOrders />}
{isDisplayCompletedOrdersEmpty && <NoCompleteOrders />}
</Box>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,14 @@ class CardanoStakingPage extends Component<AllProps, State> {
@observable notificationElementId: string = '';

cancel: void => void = () => {
const selectedWallet = this.props.stores.wallets.selected;
this.props.stores.delegation.setPoolTransitionConfig(selectedWallet, {
shouldUpdatePool: false,
show: 'idle',
});
this.props.actions.ada.delegationTransaction.reset.trigger({ justTransaction: true });
};

async componentWillUnmount() {
this.props.actions.ada.delegationTransaction.reset.trigger({ justTransaction: false });
await this.props.actions.ada.delegationTransaction.setPools.trigger([]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ class StakingPageContent extends Component<AllProps> {
}
/>
<RightCardsWrapper>
{errorIfPresent}
{!errorIfPresent && this.getStakePoolMeta(publicDeriver)}
{!errorIfPresent && this.getEpochProgress(publicDeriver)}
</RightCardsWrapper>
Expand Down
Loading