diff --git a/packages/yoroi-extension/app/assets/images/revamp/icons/info.inline.svg b/packages/yoroi-extension/app/assets/images/revamp/icons/info.inline.svg new file mode 100644 index 0000000000..dc2f19dbf1 --- /dev/null +++ b/packages/yoroi-extension/app/assets/images/revamp/icons/info.inline.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/yoroi-extension/app/components/buySell/BuySellDialog.js b/packages/yoroi-extension/app/components/buySell/BuySellDialog.js index fe8a5749ff..e368431362 100644 --- a/packages/yoroi-extension/app/components/buySell/BuySellDialog.js +++ b/packages/yoroi-extension/app/components/buySell/BuySellDialog.js @@ -8,13 +8,14 @@ import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; import { truncateAddress } from '../../utils/formatters'; import Dialog from '../widgets/Dialog'; import DialogCloseButton from '../widgets/DialogCloseButton'; -import ChangellyFetcher from './ChangellyFetcher' +import ChangellyFetcher from './ChangellyFetcher'; import styles from './BuySellDialog.scss'; -import { ReactComponent as VerifyIcon } from '../../assets/images/verify-icon.inline.svg' -import VerticalFlexContainer from '../layout/VerticalFlexContainer' -import LoadingSpinner from '../widgets/LoadingSpinner' +import { ReactComponent as VerifyIcon } from '../../assets/images/verify-icon.inline.svg'; +import VerticalFlexContainer from '../layout/VerticalFlexContainer'; +import LoadingSpinner from '../widgets/LoadingSpinner'; import globalMessages from '../../i18n/global-messages'; +import { Box } from '@mui/material'; const messages = defineMessages({ dialogTitle: { @@ -23,11 +24,13 @@ const messages = defineMessages({ }, dialogSelectAddress: { id: 'buysell.dialog.selectAddress', - defaultMessage: '!!!Please select the receiving address. This will be shared with the third party provider called Changelly for the buy / sell of ADA. ', + defaultMessage: + '!!!Please select the receiving address. This will be shared with the third party provider called Changelly for the buy / sell of ADA. ', }, dialogDescription: { id: 'buysell.dialog.instructions', - defaultMessage: '!!!Please select your preferences. On the next screen, confirm your selection by pressing the green arrow on the top right', + defaultMessage: + '!!!Please select your preferences. On the next screen, confirm your selection by pressing the green arrow on the top right', }, dialogManual: { id: 'buysell.dialog.manual', @@ -39,14 +42,15 @@ export type WalletInfo = {| walletName: string, currencyName: string, anAddressFormatted: string, -|} +|}; type Props = {| +onCancel: void => void, - +genWalletList: () => Promise> + +genWalletList: () => Promise>, |}; -const WIDGET_URL = 'https://widget.changelly.com?from=*&to=*&amount=200&fromDefault=usd&toDefault=ada&theme=default&merchant_id=g9qheu8vschp16jj&payment_id=&v=3' +const WIDGET_URL = + 'https://widget.changelly.com?from=*&to=*&amount=200&fromDefault=usd&toDefault=ada&theme=default&merchant_id=g9qheu8vschp16jj&payment_id=&v=3'; type State = {| addressSelected: ?string, @@ -55,7 +59,7 @@ type State = {| @observer export default class BuySellDialog extends Component { - static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = { + static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = { intl: intlShape.isRequired, }; @@ -64,41 +68,38 @@ export default class BuySellDialog extends Component { walletList: null, }; - async componentDidMount () { + async componentDidMount() { const { intl } = this.context; - const resp = await this.props.genWalletList() + const resp = await this.props.genWalletList(); const wallets = [ ...resp, { walletName: intl.formatMessage(messages.dialogManual), currencyName: '', anAddressFormatted: '', - } - ] - this.setState({ walletList: wallets }) + }, + ]; + this.setState({ walletList: wallets }); } - createRows: ($npm$ReactIntl$IntlFormat, Array) => Node = (intl, wallets) => ( + createRows: ($npm$ReactIntl$IntlFormat, Array) => Node = (intl, wallets) => wallets.map((wallet, i) => { return ( // eslint-disable-next-line react/no-array-index-key
- { wallet.currencyName ? `(${wallet.currencyName}) ` : ''}{wallet.walletName} -
-
- {truncateAddress(wallet.anAddressFormatted)} + {wallet.currencyName ? `(${wallet.currencyName}) ` : ''} + {wallet.walletName}
+
{truncateAddress(wallet.anAddressFormatted)}
{/* Verify Address action */}
- ) - }) - ) + ); + }); render(): Node { const { intl } = this.context; @@ -137,32 +137,27 @@ export default class BuySellDialog extends Component { closeOnOverlayClick={false} onClose={this.props.onCancel} closeButton={} - className="" >
- {intl.formatMessage(messages.dialogSelectAddress)} + {intl.formatMessage(messages.dialogSelectAddress)} {addressNodes}
- ) - } - - return ( - } - className="" - > -
-
- {intl.formatMessage(messages.dialogDescription)} -
- -
-
); + } + return ( + } + > +
+
{intl.formatMessage(messages.dialogDescription)}
+ +
+
+ ); } } diff --git a/packages/yoroi-extension/app/components/buySell/BuySellDialog.scss b/packages/yoroi-extension/app/components/buySell/BuySellDialog.scss index 9c50988475..cf70c7a277 100644 --- a/packages/yoroi-extension/app/components/buySell/BuySellDialog.scss +++ b/packages/yoroi-extension/app/components/buySell/BuySellDialog.scss @@ -4,6 +4,7 @@ padding-left: 40px; padding-right: 40px; max-height: 600px; + max-width: 600px; .description { color: var(--yoroi-palette-gray-900); @@ -20,17 +21,16 @@ flex-direction: column; letter-spacing: 0; line-height: 22px; + max-width: 600px; } .row { display: flex; - flex-direction: row; - height: 60px; - align-items: flex-start; + flex-flow: row nowrap; + align-items: center; + justify-content: space-between; .left { - flex: 7; - .nameAndCurrency { color: var(--yoroi-palette-gray-900); font-size: 16px; @@ -44,15 +44,6 @@ line-height: 22px; } } - .right { - flex: 1; - width: 40px; - height: 40px; - } -} - -.row:first-child { - margin-top: 40px; } .verifyIcon { diff --git a/packages/yoroi-extension/app/components/topbar/WalletListDialog.js b/packages/yoroi-extension/app/components/topbar/WalletListDialog.js index 997bb302bb..de71fcc31d 100644 --- a/packages/yoroi-extension/app/components/topbar/WalletListDialog.js +++ b/packages/yoroi-extension/app/components/topbar/WalletListDialog.js @@ -1,27 +1,26 @@ // @flow -import { BigNumber } from 'bignumber.js'; import type { Node } from 'react'; +import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; +import type { TokenLookupKey } from '../../api/common/lib/MultiToken'; +import type { TokenRow } from '../../api/ada/lib/storage/database/primitives/tables'; +import type { UnitOfAccountSettingType } from '../../types/unitOfAccountType'; +import type { WalletsNavigation } from '../../api/localStorage'; +import { BigNumber } from 'bignumber.js'; import { Component } from 'react'; import { observer } from 'mobx-react'; import { defineMessages, intlShape } from 'react-intl'; -import DialogRevamp from '../widgets/DialogRevamp'; -import DialogCloseButton from '../widgets/DialogCloseButton'; -import styles from './WalletListDialog.scss'; -import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; import { ReactComponent as IconEyeOpen } from '../../assets/images/my-wallets/icon_eye_open.inline.svg'; import { ReactComponent as IconEyeClosed } from '../../assets/images/my-wallets/icon_eye_closed.inline.svg'; -import type { TokenLookupKey } from '../../api/common/lib/MultiToken'; -import type { TokenRow } from '../../api/ada/lib/storage/database/primitives/tables'; import { MultiToken } from '../../api/common/lib/MultiToken'; -import WalletCard from './WalletCard'; import { DragDropContext, Droppable } from 'react-beautiful-dnd'; -import globalMessages from '../../i18n/global-messages'; -import type { UnitOfAccountSettingType } from '../../types/unitOfAccountType'; -import AmountDisplay, { FiatDisplay } from '../common/AmountDisplay'; -import type { WalletsNavigation } from '../../api/localStorage'; -import { Button, Stack } from '@mui/material'; import { Box } from '@mui/system'; import { PublicDeriver } from '../../api/ada/lib/storage/models/PublicDeriver'; +import Dialog from '../widgets/Dialog'; +import DialogCloseButton from '../widgets/DialogCloseButton'; +import styles from './WalletListDialog.scss'; +import WalletCard from './WalletCard'; +import globalMessages from '../../i18n/global-messages'; +import AmountDisplay, { FiatDisplay } from '../common/AmountDisplay'; const messages = defineMessages({ addWallet: { @@ -185,12 +184,31 @@ export default class WalletListDialog extends Component { const walletsTotal = this.renderWalletsTotal(); return ( - } onClose={this.props.close} + actions={[ + { + id: 'addWalletButton', + onClick: onAddWallet, + size: 'large', + label: intl.formatMessage(messages.addWallet), + }, + { + id: 'applyWalletButton', + onClick: this.onSelect, + size: 'large', + disabled: + this.state.selectedWallet === null || + this.isCurrentWallet(this.state.selectedWallet, 'global'), + primary: true, + label: intl.formatMessage(messages.applyWallet), + }, + ]} + scrollableContentClass="WalletList" >
@@ -206,7 +224,7 @@ export default class WalletListDialog extends Component {
- + {cardanoWalletsIdx.length > 0 && (

{intl.formatMessage(messages.cardano)}

@@ -277,42 +295,8 @@ export default class WalletListDialog extends Component { - - - - - + ); } diff --git a/packages/yoroi-extension/app/components/topbar/WalletListDialog.scss b/packages/yoroi-extension/app/components/topbar/WalletListDialog.scss index 7208cf4288..0e65e3615b 100644 --- a/packages/yoroi-extension/app/components/topbar/WalletListDialog.scss +++ b/packages/yoroi-extension/app/components/topbar/WalletListDialog.scss @@ -1,25 +1,9 @@ .component { - font-size: 16px; - min-width: 675px !important; - height: 700px; - max-height: unset !important; - padding-right: 0 !important; - padding-bottom: 0px !important; - - & > div { - padding: 0px; - max-height: unset !important; - } - .header { position: sticky; top: 0px; background: var(--yoroi-comp-dialog-background); padding-bottom: 14px; - - padding-top: 14px; - padding-left: 40px; - } .totalInfo { @@ -48,7 +32,7 @@ } .sectionHeader { - color: #A7AFC0; + color: #a7afc0; font-size: 14px; margin-top: 26px; } @@ -60,4 +44,3 @@ overflow-y: auto; } } - diff --git a/packages/yoroi-extension/app/components/transfer/ErrorPage.js b/packages/yoroi-extension/app/components/transfer/ErrorPage.js index bc61d0d791..daaaa04b28 100644 --- a/packages/yoroi-extension/app/components/transfer/ErrorPage.js +++ b/packages/yoroi-extension/app/components/transfer/ErrorPage.js @@ -46,7 +46,6 @@ export default class ErrorPage extends Component { closeOnOverlayClick={false} closeButton={} onClose={onCancel} - className={styles.dialog} >
diff --git a/packages/yoroi-extension/app/components/transfer/ErrorPage.scss b/packages/yoroi-extension/app/components/transfer/ErrorPage.scss index c0ac735a62..af65710ca6 100644 --- a/packages/yoroi-extension/app/components/transfer/ErrorPage.scss +++ b/packages/yoroi-extension/app/components/transfer/ErrorPage.scss @@ -5,6 +5,7 @@ height: 100%; align-items: center; justify-content: center; + max-width: 600px; } .body { diff --git a/packages/yoroi-extension/app/components/transfer/SuccessPageRevamp.js b/packages/yoroi-extension/app/components/transfer/SuccessPageRevamp.js index a7e292ddbc..e89d2387a8 100644 --- a/packages/yoroi-extension/app/components/transfer/SuccessPageRevamp.js +++ b/packages/yoroi-extension/app/components/transfer/SuccessPageRevamp.js @@ -7,7 +7,7 @@ import DialogCloseButton from '../widgets/DialogCloseButton'; import LoadingSpinner from '../widgets/LoadingSpinner'; import { Box, Typography } from '@mui/material'; import { ReactComponent as SuccessImg } from '../../assets/images/transfer-success.inline.svg'; -import DialogRevamp from '../widgets/DialogRevamp'; +import Dialog from '../widgets/Dialog'; type Props = {| +title: string, @@ -38,7 +38,7 @@ export class SuccessPageRevamp extends Component { ]; return ( - { > - + {text} {this.props.closeInfo == null && } - + ); } } diff --git a/packages/yoroi-extension/app/components/uri/URIDisplayDialog.js b/packages/yoroi-extension/app/components/uri/URIDisplayDialog.js index cf992d525a..afd571598a 100644 --- a/packages/yoroi-extension/app/components/uri/URIDisplayDialog.js +++ b/packages/yoroi-extension/app/components/uri/URIDisplayDialog.js @@ -1,21 +1,22 @@ // @flow import type { Node } from 'react'; +import type { Notification } from '../../types/notificationType'; +import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; import { Component } from 'react'; -import classnames from 'classnames'; import { observer } from 'mobx-react'; import { intlShape, defineMessages } from 'react-intl'; import { buildURI } from '../../utils/URIHandling'; +import { ReactComponent as InfoIcon } from '../../assets/images/revamp/icons/info.inline.svg'; +import { Box, Typography } from '@mui/material'; +import classnames from 'classnames'; import Dialog from '../widgets/Dialog'; import DialogBackButton from '../widgets/DialogBackButton'; import DialogCloseButton from '../widgets/DialogCloseButton'; import QrCodeWrapper from '../widgets/QrCodeWrapper'; -import WarningBox from '../widgets/WarningBox'; import CopyableAddress from '../widgets/CopyableAddress'; -import type { Notification } from '../../types/notificationType'; -import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; import BigNumber from 'bignumber.js'; - import styles from './URIDisplayDialog.scss'; +import globalMessages from '../../i18n/global-messages'; const messages = defineMessages({ uriDisplayDialogTitle: { @@ -28,8 +29,9 @@ const messages = defineMessages({ }, usabilityWarning: { id: 'uri.display.dialog.usabilityWarning', - defaultMessage: '!!!This link can only be opened by users with Yoroi installed on their browser', - } + defaultMessage: + '!!!This link can only be opened by users with Yoroi installed on their browser', + }, }); type Props = {| @@ -43,32 +45,18 @@ type Props = {| @observer export default class URIDisplayDialog extends Component { - - static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = { + static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = { intl: intlShape.isRequired, }; render(): Node { - const { - onClose, - onBack, - notification, - onCopyAddressTooltip, - address, - amount, - } = this.props; + const { onClose, onBack, notification, onCopyAddressTooltip, address, amount } = this.props; const { intl } = this.context; const uri = buildURI(address, amount); const uriNotificationId = 'uri-copyNotification'; - const uriUsabilityWarning = ( - - {intl.formatMessage(messages.usabilityWarning)} - - ); - return ( { onClose={onClose} backButton={} > - {uriUsabilityWarning} -
- -
-
- onCopyAddressTooltip(uriNotificationId)} - notification={notification} - placementTooltip="bottom-start" + + - {uri} - -
+ + + + + + {intl.formatMessage(globalMessages.important)} + + + + {intl.formatMessage(messages.usabilityWarning)} + + +
+ +
+
+ onCopyAddressTooltip(uriNotificationId)} + notification={notification} + placementTooltip="bottom-start" + sx={{ + alignItems: 'flex-start', + '& > .CopyableAddress_copyIconBig': { + p: '6px', + width: 'auto', + height: 'auto', + }, + }} + > + {uri} + +
+
- ); } - } diff --git a/packages/yoroi-extension/app/components/uri/URIDisplayDialog.scss b/packages/yoroi-extension/app/components/uri/URIDisplayDialog.scss index 8b7083b8cc..053c5fd381 100644 --- a/packages/yoroi-extension/app/components/uri/URIDisplayDialog.scss +++ b/packages/yoroi-extension/app/components/uri/URIDisplayDialog.scss @@ -1,38 +1,27 @@ .component { - min-width: var(--yoroi-comp-dialog-min-width-lg) !important; - max-width: var(--yoroi-comp-dialog-min-width-lg) !important; - :global { .Dialog_title { margin-bottom: 24px; } - - .CopyableAddress_copyIconBig { - & > svg { - margin-top: -7px; - } - } } .uriDisplay { - width: 90%; margin-left: auto; margin-right: auto; - margin-bottom: 24px; display: flex; - align-items: center; + align-items: flex-start; .uri { font-weight: 400; word-break: break-all; font-size: 16px; line-height: 24px; - text-align: center; + text-align: left; } } .qrCode { - margin: 34px auto 20px auto; + margin: 24px auto; text-align: center; } } diff --git a/packages/yoroi-extension/app/components/uri/URIGenerateDialog.js b/packages/yoroi-extension/app/components/uri/URIGenerateDialog.js index 9b9bb35013..af5d20f7a7 100644 --- a/packages/yoroi-extension/app/components/uri/URIGenerateDialog.js +++ b/packages/yoroi-extension/app/components/uri/URIGenerateDialog.js @@ -22,7 +22,8 @@ import { getTokenName } from '../../stores/stateless/tokenHelpers'; import BigNumber from 'bignumber.js'; import styles from './URIGenerateDialog.scss'; -import ThemedDialog from '../widgets/ThemedDialog'; +// import ThemedDialog from '../widgets/ThemedDialog'; +import Dialog from '../widgets/Dialog'; const messages = defineMessages({ uriGenerateDialogTitle: { @@ -140,7 +141,7 @@ export default class URIGenerateDialog extends Component { ]; return ( - { />
- + ); } } diff --git a/packages/yoroi-extension/app/components/uri/URIGenerateDialog.scss b/packages/yoroi-extension/app/components/uri/URIGenerateDialog.scss index 39c08504b6..19e693410f 100644 --- a/packages/yoroi-extension/app/components/uri/URIGenerateDialog.scss +++ b/packages/yoroi-extension/app/components/uri/URIGenerateDialog.scss @@ -1,7 +1,4 @@ .component { - min-width: var(--yoroi-comp-dialog-min-width-lg) !important; - max-width: var(--yoroi-comp-dialog-min-width-lg) !important; - :global { .Dialog_title { margin-bottom: 30px; diff --git a/packages/yoroi-extension/app/components/wallet/export/ExportTransactionDialog.js b/packages/yoroi-extension/app/components/wallet/export/ExportTransactionDialog.js index 5168af2a05..39587180cd 100644 --- a/packages/yoroi-extension/app/components/wallet/export/ExportTransactionDialog.js +++ b/packages/yoroi-extension/app/components/wallet/export/ExportTransactionDialog.js @@ -6,8 +6,7 @@ import { defineMessages, intlShape } from 'react-intl'; import LocalizableError from '../../../i18n/LocalizableError'; import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; import type { TransactionRowsToExportRequest } from '../../../actions/common/transactions-actions'; -import ClassicDialog from '../../widgets/Dialog'; -import DialogRevamp from '../../widgets/DialogRevamp'; +import Dialog from '../../widgets/Dialog'; import DialogCloseButton from '../../widgets/DialogCloseButton'; import ErrorBlock from '../../widgets/ErrorBlock'; import globalMessages from '../../../i18n/global-messages'; @@ -110,8 +109,6 @@ class ExportTransactionDialog extends Component { render(): Node { const { intl } = this.context; - const { isRevampLayout } = this.props; const dialogActions = !this.props.isHardware ? [] @@ -91,8 +87,6 @@ class VerifyAddressDialog extends Component { }, ]; - const Dialog = isRevampLayout ? DialogClassic : DialogRevamp; - return ( { return ( <>
- +


diff --git a/packages/yoroi-extension/app/components/wallet/receive/VerifyAddressDialog.scss b/packages/yoroi-extension/app/components/wallet/receive/VerifyAddressDialog.scss index 8be3422a0b..44f6729fd2 100644 --- a/packages/yoroi-extension/app/components/wallet/receive/VerifyAddressDialog.scss +++ b/packages/yoroi-extension/app/components/wallet/receive/VerifyAddressDialog.scss @@ -26,7 +26,7 @@ line-height: 22px; } -:global(.YoroiModern), :global(.YoroiRevamp) { +:global(.YoroiModern) { .component { min-width: var(--yoroi-comp-dialog-min-width-lg); max-width: var(--yoroi-comp-dialog-min-width-lg); diff --git a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddNFTDialog.js b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddNFTDialog.js index 4db8eea8db..3c24dcd12a 100644 --- a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddNFTDialog.js +++ b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddNFTDialog.js @@ -1,31 +1,31 @@ // @flow /* eslint react/jsx-one-expression-per-line: 0 */ // the   in the html breaks this -import { Component } from 'react'; import type { Node } from 'react'; -import { observer } from 'mobx-react'; -import { defineMessages, intlShape } from 'react-intl'; -import Dialog from '../../../widgets/Dialog'; -import styles from './AddNFTDialog.scss'; import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; -import { MultiToken } from '../../../../api/common/lib/MultiToken'; -import { ReactComponent as SearchIcon } from '../../../../assets/images/assets-page/search.inline.svg'; -import { ReactComponent as NoItemsFoundImg } from '../../../../assets/images/assets-page/no-nfts.inline.svg'; -import { getNFTs } from '../../../../utils/wallet'; import type { FormattedNFTDisplay } from '../../../../utils/wallet'; -import BigNumber from 'bignumber.js'; import type { TokenLookupKey } from '../../../../api/common/lib/MultiToken'; import type { TokenRow, NetworkRow, } from '../../../../api/ada/lib/storage/database/primitives/tables'; -import { Button, OutlinedInput, Typography } from '@mui/material'; +import { Component } from 'react'; +import { observer } from 'mobx-react'; +import { defineMessages, intlShape } from 'react-intl'; +import { MultiToken } from '../../../../api/common/lib/MultiToken'; +import { ReactComponent as SearchIcon } from '../../../../assets/images/assets-page/search.inline.svg'; +import { ReactComponent as NoItemsFoundImg } from '../../../../assets/images/assets-page/no-nfts.inline.svg'; +import { getNFTs } from '../../../../utils/wallet'; +import { OutlinedInput, Typography } from '@mui/material'; import { isCardanoHaskell } from '../../../../api/ada/lib/storage/database/prepackaged/networks'; +import { Box } from '@mui/system'; +import { ampli } from '../../../../../ampli/index'; import MinAda from './MinAda'; +import Dialog from '../../../widgets/Dialog'; +import styles from './AddNFTDialog.scss'; +import BigNumber from 'bignumber.js'; import NFTImage from './NFTImage'; import globalMessages from '../../../../i18n/global-messages'; import MaxAssetsError from '../MaxAssetsError'; -import { Box } from '@mui/system'; -import { ampli } from '../../../../../ampli/index'; type Props = {| +onClose: void => void, @@ -161,8 +161,8 @@ export default class AddNFTDialog extends Component { changed = true; } } else if (included) { - tokens.push({ tokenId: token.TokenId }); - changed = true; + tokens.push({ tokenId: token.TokenId }); + changed = true; } if (!included) { toRemove.push(token); @@ -188,6 +188,8 @@ export default class AddNFTDialog extends Component { const { onClose, calculateMinAda, shouldAddMoreTokens } = this.props; const { currentNftsList, fullNftsList, selectedTokens } = this.state; const shouldAddMore = shouldAddMoreTokens(selectedTokens); + const hasSelectedTokensIncluded = selectedTokens.filter(t => t.included); + return ( { className={styles.dialog} onClose={onClose} withCloseButton + scrollableContentClass={styles.nftsGrid} + actions={[ + { + disabled: + hasSelectedTokensIncluded.length === 0 || + !shouldAddMore || + currentNftsList.length === 0, + onClick: this.onAddAll, + primary: true, + label: intl.formatMessage(globalMessages.confirm), + }, + ]} >
@@ -288,16 +302,6 @@ export default class AddNFTDialog extends Component { )}
- - -
); } diff --git a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddNFTDialog.scss b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddNFTDialog.scss index a9b67d629f..b591a09a42 100644 --- a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddNFTDialog.scss +++ b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddNFTDialog.scss @@ -3,14 +3,13 @@ width: 100%; display: flex; flex-direction: column; - padding: 0px 24px; + max-width: 648px; .search { border-radius: 8px; background-color: #f0f3f5; display: flex; align-items: center; - padding: 0px 20px; margin-bottom: 20px; .searchInput { @@ -70,7 +69,7 @@ .nftsGrid { display: grid; grid-template-columns: repeat(3, 1fr); - grid-gap: 25px; + grid-gap: 24px; padding-bottom: 20px; height: 100%; max-height: 360px; @@ -99,18 +98,3 @@ } } } - -.dialog { - min-width: 690px !important; - padding: 0px !important; - - & > div { - padding-left: 0px !important; - padding-right: 0px; - max-height: unset; - } - - h1 { - padding: 0px; - } -} diff --git a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddTokenDialog.js b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddTokenDialog.js index f0638b9374..4aa1235546 100644 --- a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddTokenDialog.js +++ b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddTokenDialog.js @@ -14,27 +14,27 @@ import { Component } from 'react'; import { observer } from 'mobx-react'; import { defineMessages, intlShape } from 'react-intl'; import { MultiToken } from '../../../../api/common/lib/MultiToken'; -import { Button, Typography } from '@mui/material'; +import { Typography } from '@mui/material'; import { isCardanoHaskell } from '../../../../api/ada/lib/storage/database/prepackaged/networks'; import { compareNumbers, compareStrings } from '../../assets/AssetsList'; import { getTokens } from '../../../../utils/wallet'; import { Box } from '@mui/system'; import { formattedAmountToNaturalUnits } from '../../../../utils/formatters'; -import Dialog from '../../../widgets/Dialog'; -import styles from './AddTokenDialog.scss'; import { ReactComponent as SearchIcon } from '../../../../assets/images/assets-page/search.inline.svg'; import { ReactComponent as ArrowsListFromBottom } from '../../../../assets/images/assets-page/arrows-list-from-bottom.inline.svg'; import { ReactComponent as ArrowsListFromTop } from '../../../../assets/images/assets-page/arrows-list-from-top.inline.svg'; import { ReactComponent as InfoIcon } from '../../../../assets/images/revamp/fingerprint-info.inline.svg'; import { ReactComponent as ArrowsList } from '../../../../assets/images/assets-page/arrows-list.inline.svg'; import { ReactComponent as NoItemsFoundImg } from '../../../../assets/images/assets-page/no-tokens.inline.svg'; +import { ampli } from '../../../../../ampli/index'; +import Dialog from '../../../widgets/Dialog'; +import styles from './AddTokenDialog.scss'; import SingleTokenRow from './SingleTokenRow'; import BigNumber from 'bignumber.js'; import MinAda from './MinAda'; import globalMessages from '../../../../i18n/global-messages'; import MaxAssetsError from '../MaxAssetsError'; import OutlinedInput from '@mui/material/OutlinedInput'; -import { ampli } from '../../../../../ampli/index'; type Props = {| +onClose: void => void, @@ -332,6 +332,8 @@ export default class AddTokenDialog extends Component { const shouldAddMore = shouldAddMoreTokens( selectedTokens.map(({ token, included }) => ({ token, included })) ); + const hasSelectedTokensIncluded = selectedTokens.filter(t => t.included); + return ( { ? intl.formatMessage(globalMessages.tokens) : intl.formatMessage(messages.nTokens, { number: fullTokensList.length }) } + actions={[ + { + disabled: + fullTokensList.length === 0 || + hasSelectedTokensIncluded.length === 0 || + !this.isValidAmounts() || + !shouldAddMore, + onClick: this.onAddAll, + primary: true, + label: intl.formatMessage(globalMessages.confirm), + }, + ]} closeOnOverlayClick={false} className={styles.dialog} onClose={onClose} withCloseButton + scrollableContentClass="CurrentTokensList" > - + - + { )} {!shouldAddMore && ( - + )} @@ -401,7 +416,6 @@ export default class AddTokenDialog extends Component { borderBottom="1px solid" borderBottomColor="grayscale.200" className={styles.columns} - px="24px" >
  • -
  • ); } diff --git a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddTokenDialog.scss b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddTokenDialog.scss index 49ab27abb7..5144dc91b2 100644 --- a/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddTokenDialog.scss +++ b/packages/yoroi-extension/app/components/wallet/send/WalletSendFormSteps/AddTokenDialog.scss @@ -3,6 +3,7 @@ height: 100%; display: flex; flex-direction: column; + max-width: 600px; .search { border-radius: 8px; @@ -96,14 +97,3 @@ } } } - -.dialog { - min-width: 670px !important; - padding: 0 !important; - - & > div { - padding-left: 0px !important; - max-height: unset; - padding-right: 0px !important; - } -} diff --git a/packages/yoroi-extension/app/components/wallet/settings/ChangeWalletPasswordDialog.js b/packages/yoroi-extension/app/components/wallet/settings/ChangeWalletPasswordDialog.js index 55b15d8f4b..97d7e229f9 100644 --- a/packages/yoroi-extension/app/components/wallet/settings/ChangeWalletPasswordDialog.js +++ b/packages/yoroi-extension/app/components/wallet/settings/ChangeWalletPasswordDialog.js @@ -8,8 +8,7 @@ import { defineMessages, intlShape } from 'react-intl'; import ReactToolboxMobxForm from '../../../utils/ReactToolboxMobxForm'; import vjf from 'mobx-react-form/lib/validators/VJF'; import DialogCloseButton from '../../widgets/DialogCloseButton'; -import DialogClassic from '../../widgets/Dialog'; -import DialogRevamp from '../../widgets/DialogRevamp'; +import Dialog from '../../widgets/Dialog'; import { isValidWalletPassword, isValidRepeatPassword } from '../../../utils/validations'; import globalMessages from '../../../i18n/global-messages'; import LocalizableError from '../../../i18n/LocalizableError'; @@ -141,7 +140,7 @@ export default class ChangeWalletPasswordDialog extends Component { render(): Node { const { form } = this; const { intl } = this.context; - const { onCancel, isSubmitting, dialogData, error, isClassicTheme, isRevampTheme } = this.props; + const { onCancel, isSubmitting, dialogData, error, isClassicTheme } = this.props; const dialogClasses = classnames(['changePasswordDialog', styles.dialog]); @@ -176,8 +175,6 @@ export default class ChangeWalletPasswordDialog extends Component { }, ]; - const Dialog = isRevampTheme ? DialogRevamp : DialogClassic; - return ( { ); const revampLayout = ( - { ) : null} - + ); return this.props.renderLayoutComponent({ diff --git a/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/RewardHistoryDialog.js b/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/RewardHistoryDialog.js index a232cf47d0..011dcf6bd5 100644 --- a/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/RewardHistoryDialog.js +++ b/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/RewardHistoryDialog.js @@ -17,7 +17,6 @@ import LoadingSpinner from '../../../widgets/LoadingSpinner'; import VerticallyCenteredLayout from '../../../layout/VerticallyCenteredLayout'; import LocalizableError from '../../../../i18n/LocalizableError'; import { groupByPoolName } from '../utils'; -import styles from './RewardHistoryDialog.scss'; const messages = defineMessages({ epoch: { @@ -53,49 +52,49 @@ function RewardHistoryDialog({ graphData, onClose, intl }: Props & Intl): Node { return ( } onClose={onClose} - className={styles.dialog} > - - {intl.formatMessage(globalMessages.rewardsListLabel)} ({rewardList.length}) - - - {graphData.rewardsGraphData.error && ( -
    -
    - -
    - -
    - )} - {rewardList == null ? ( - - - - ) : ( - Object.entries(rewardsByPoolName ?? {}).map(([poolName, data]) => ( - ({ - // TODO: Make sure it's "received" in all use cases - type: intl.formatMessage(messages.epoch, { number: item.name }), - date: item.date, - balance: item.primary, - currency: item.currency, - }))} - /> - )) - )} + + + {intl.formatMessage(globalMessages.rewardsListLabel)} ({rewardList.length}) + + + {graphData.rewardsGraphData.error && ( +
    +
    + +
    + +
    + )} + {rewardList == null ? ( + + + + ) : ( + Object.entries(rewardsByPoolName ?? {}).map(([poolName, data]) => ( + ({ + // TODO: Make sure it's "received" in all use cases + type: intl.formatMessage(messages.epoch, { number: item.name }), + date: item.date, + balance: item.primary, + currency: item.currency, + }))} + /> + )) + )} +
    ); diff --git a/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/RewardHistoryDialog.scss b/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/RewardHistoryDialog.scss deleted file mode 100644 index f24bb23d7b..0000000000 --- a/packages/yoroi-extension/app/components/wallet/staking/dashboard-revamp/RewardHistoryDialog.scss +++ /dev/null @@ -1,5 +0,0 @@ -.dialog { - & > h1.dialog__title { - margin-bottom: 26px; - } -} \ No newline at end of file diff --git a/packages/yoroi-extension/app/components/widgets/DangerousActionDialog.js b/packages/yoroi-extension/app/components/widgets/DangerousActionDialog.js index 65dbe7e26b..fd52157579 100644 --- a/packages/yoroi-extension/app/components/widgets/DangerousActionDialog.js +++ b/packages/yoroi-extension/app/components/widgets/DangerousActionDialog.js @@ -1,19 +1,19 @@ // @flow -import { Component } from 'react'; import type { Node, ComponentType } from 'react'; +import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; +import type { InjectedLayoutProps } from '../../styles/context/layout'; +import { Component } from 'react'; import { observer } from 'mobx-react'; -import classnames from 'classnames'; import { intlShape } from 'react-intl'; +import { withLayout } from '../../styles/context/layout'; +import { Box, FormControlLabel, Checkbox as MuiCheckbox } from '@mui/material'; +import classnames from 'classnames'; import DialogCloseButton from './DialogCloseButton'; -import ThemedDialog from './ThemedDialog'; +import Dialog from './Dialog'; import globalMessages from '../../i18n/global-messages'; import LocalizableError from '../../i18n/LocalizableError'; import CheckboxLabel from '../common/CheckboxLabel'; import styles from './DangerousActionDialog.scss'; -import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; -import { withLayout } from '../../styles/context/layout'; -import type { InjectedLayoutProps } from '../../styles/context/layout'; -import { Box, FormControlLabel, Checkbox as MuiCheckbox } from '@mui/material'; type Props = {| +title: string, @@ -27,6 +27,7 @@ type Props = {| +primaryButton: {| +label: string, +onClick: void => PossiblyAsync, + +danger?: boolean, |}, +secondaryButton: {| label?: string, @@ -64,7 +65,7 @@ class DangerousActionDialog extends Component { primary: true, className: confirmButtonClasses, disabled: !this.props.isChecked ? true : undefined, - danger: true, + danger: this.props.primaryButton.danger ?? true, isSubmitting: this.props.isSubmitting, ...(this.props.primaryButton ?? Object.freeze({})), }, @@ -86,25 +87,19 @@ class DangerousActionDialog extends Component { ); const revampLayout = ( - + {this.props.children} - + } - sx={{ - marginLeft: '-0px', - }} + sx={{ marginLeft: '-0px' }} /> {error ?

    {intl.formatMessage(error, error.values)}

    : null} @@ -117,7 +112,7 @@ class DangerousActionDialog extends Component { }); return ( - { closeButton={} > {content} - +
    ); } } diff --git a/packages/yoroi-extension/app/components/widgets/DangerousActionDialog.scss b/packages/yoroi-extension/app/components/widgets/DangerousActionDialog.scss index ea273b8d24..cb2e458e25 100644 --- a/packages/yoroi-extension/app/components/widgets/DangerousActionDialog.scss +++ b/packages/yoroi-extension/app/components/widgets/DangerousActionDialog.scss @@ -45,10 +45,6 @@ .checkbox { padding-bottom: 0px; } - - & > div:nth-child(3) { - margin-top: 24px; - } } } diff --git a/packages/yoroi-extension/app/components/widgets/Dialog.js b/packages/yoroi-extension/app/components/widgets/Dialog.js index d4b0c3013d..a6b36532eb 100644 --- a/packages/yoroi-extension/app/components/widgets/Dialog.js +++ b/packages/yoroi-extension/app/components/widgets/Dialog.js @@ -1,10 +1,10 @@ /* eslint-disable no-nested-ternary */ // @flow import type { Node, Element, ComponentType } from 'react'; -import React from 'react'; +import React, { useEffect, useState } from 'react'; import classnames from 'classnames'; import { map } from 'lodash'; -import { IconButton, Modal, Typography } from '@mui/material'; +import { IconButton, Modal, Typography, alpha } from '@mui/material'; import { Box, styled } from '@mui/system'; import { LoadingButton } from '@mui/lab'; import { withLayout } from '../../styles/context/layout'; @@ -19,6 +19,8 @@ export type ActionType = {| +isSubmitting?: boolean, +disabled?: boolean, +className?: ?string, + +id?: ?string, + +size?: ?string, |}; export type Props = {| @@ -29,6 +31,7 @@ export type Props = {| +withCloseButton?: boolean, +backButton?: Node, +className?: string, + +scrollableContentClass?: string, +styleOverride?: { ... }, +onClose?: ?(void) => PossiblyAsync, +closeOnOverlayClick?: boolean, @@ -48,9 +51,36 @@ function DialogFn(props: Props & InjectedProps): Node { closeButton, withCloseButton, backButton, + scrollableContentClass, isRevampLayout, } = props; + const [contentHasScroll, setContentHasScroll] = useState(false); + + useEffect(() => { + const timeout = setTimeout(() => { + const el = document.querySelector( + scrollableContentClass ? `.${scrollableContentClass}` : '.ModalContent' + ); + + if (!el) return; + + if (el.clientHeight < el.scrollHeight) { + setContentHasScroll(true); + el.style.marginRight = '-24px'; + } else { + setContentHasScroll(false); + el.style.marginRight = '0'; + } + }, 30); + + return () => { + clearTimeout(timeout); + }; + }, [children]); + + const hasActions = actions && actions.length > 0; + const hasCloseButton = withCloseButton || closeButton; const hasSubmitting = @@ -69,7 +99,9 @@ function DialogFn(props: Props & InjectedProps): Node { } } sx={{ - background: 'var(--yoroi-comp-dialog-overlay-background-color)', + bgcolor: isRevampLayout + ? alpha('#121F4D', 0.7) // primary.900 70% + : 'var(--yoroi-comp-dialog-overlay-background-color)', display: 'flex', justifyContent: 'center', alignItems: 'center', @@ -81,15 +113,23 @@ function DialogFn(props: Props & InjectedProps): Node { className={className} style={props.styleOverride} boxShadow="0px 13px 20px -1px #00000026" + contentHasScroll={contentHasScroll} > {title != null && title !== '' ? ( {title} ) : null} - {children != null ? {children} : null} - {actions && actions.length > 0 && ( - + {children != null ? ( + + {children} + + ) : null} + {hasActions && ( + {map(actions, (action, i: number) => { const buttonClasses = classnames([ // Keep classnames for testing @@ -98,13 +138,14 @@ function DialogFn(props: Props & InjectedProps): Node { ]); return ( {action.label} @@ -131,6 +172,7 @@ DialogFn.defaultProps = { closeButton: undefined, backButton: undefined, className: undefined, + scrollableContentClass: undefined, styleOverride: undefined, onClose: undefined, closeOnOverlayClick: false, @@ -155,15 +197,15 @@ const CloseButton = ({ onClose, closeButton }) => ( ); -const ModalContainer = styled(Box)(({ theme }) => ({ +const ModalContainer = styled(Box)(({ theme, contentHasScroll }) => ({ position: 'relative', minWidth: theme.name === 'classic' || theme.name === 'modern' ? 'var(--yoroi-comp-dialog-min-width-md)' - : '612px', + : '648px', borderRadius: theme.name === 'classic' ? 0 : 8, paddingTop: theme.name === 'classic' ? '25px' : '0px', - paddingBottom: theme.name === 'classic' ? '30px' : '24px', + paddingBottom: theme.name === 'classic' || theme.name === 'modern' ? '30px' : '0px', maxWidth: theme.name === 'classic' ? '785px' : '824px', backgroundColor: 'var(--yoroi-comp-dialog-background)', color: 'var(--yoroi-comp-dialog-text)', @@ -178,34 +220,46 @@ const ModalContainer = styled(Box)(({ theme }) => ({ textTransform: 'uppercase', letterSpacing: 0, display: 'block', - borderBottom: '1px solid', - borderBottomColor: theme.palette.grayscale['200'], + borderBottom: + theme.name === 'classic' || theme.name === 'modern' + ? '' + : contentHasScroll + ? '1px solid' + : '', + borderBottomColor: + theme.name === 'classic' || theme.name === 'modern' + ? theme.palette.gray['200'] + : theme.palette.grayscale['200'], }, })); const ModalContent = styled(Box)(({ theme }) => ({ overflowX: 'hidden', overflowY: 'overlay', - maxHeight: '60vh', + maxHeight: '70vh', paddingLeft: theme.name === 'classic' ? '30px' : '24px', paddingRight: theme.name === 'classic' ? '30px' : '24px', - paddingTop: theme.name === 'classic' ? '0px' : '16px', + paddingTop: theme.name === 'classic' ? '0px' : '24px', + paddingBottom: theme.name === 'classic' || theme.name === 'modern' ? '0px' : '24px', })); -const ModalFooter = styled(Box)(({ theme }) => ({ +const ModalFooter = styled(Box)(({ theme, contentHasScroll }) => ({ display: 'flex', + gap: '24px', paddingLeft: theme.name === 'classic' ? '30px' : '24px', paddingRight: theme.name === 'classic' ? '30px' : '24px', - marginTop: theme.name === 'classic' ? '20px' : '34px', + paddingTop: theme.name === 'classic' || theme.name === 'modern' ? '0' : '24px', + paddingBottom: theme.name === 'classic' || theme.name === 'modern' ? '0' : '24px', + marginTop: theme.name === 'classic' ? '20px' : '0px', + borderTop: + theme.name === 'classic' || theme.name === 'modern' ? '' : contentHasScroll ? '1px solid' : '', + borderTopColor: + theme.name === 'classic' || theme.name === 'modern' + ? theme.palette.gray['200'] + : theme.palette.grayscale['200'], '& button': { width: '50%', - '&:only-child': { - margin: 'auto', - width: '100%', - }, - '& + button': { - marginLeft: '20px', - }, + '&:only-child': { width: '100%' }, }, })); diff --git a/packages/yoroi-extension/app/components/widgets/DialogCloseButton.js b/packages/yoroi-extension/app/components/widgets/DialogCloseButton.js index 32de3cffd2..6a7be958cd 100644 --- a/packages/yoroi-extension/app/components/widgets/DialogCloseButton.js +++ b/packages/yoroi-extension/app/components/widgets/DialogCloseButton.js @@ -28,15 +28,7 @@ class DialogCloseButton extends Component { const Svg = icon != null && icon !== '' ? icon : defaultIcon; return ( - + ); diff --git a/packages/yoroi-extension/app/components/widgets/ThemedDialog.js b/packages/yoroi-extension/app/components/widgets/ThemedDialog.js index 8ee0ded39b..d2d024c667 100644 --- a/packages/yoroi-extension/app/components/widgets/ThemedDialog.js +++ b/packages/yoroi-extension/app/components/widgets/ThemedDialog.js @@ -4,13 +4,11 @@ import type { Node, ComponentType } from 'react'; import type { Props } from './Dialog'; import { withLayout } from '../../styles/context/layout'; import type { InjectedLayoutProps } from '../../styles/context/layout'; -import DialogClassic from './Dialog'; -import DialogRevamp from './DialogRevamp'; +import Dialog from './Dialog'; class ThemedDialog extends Component { render(): Node { const { - isRevampLayout, children, title, actions, @@ -20,7 +18,6 @@ class ThemedDialog extends Component { closeButton, backButton, } = this.props; - const Dialog = isRevampLayout ? DialogRevamp : DialogClassic; const dialogProps = { title, @@ -31,6 +28,7 @@ class ThemedDialog extends Component { className, backButton, }; + return {children}; } } diff --git a/packages/yoroi-extension/app/containers/settings/categories/ResyncWalletDialogContainer.js b/packages/yoroi-extension/app/containers/settings/categories/ResyncWalletDialogContainer.js index e41c482456..e16b9ba2c4 100644 --- a/packages/yoroi-extension/app/containers/settings/categories/ResyncWalletDialogContainer.js +++ b/packages/yoroi-extension/app/containers/settings/categories/ResyncWalletDialogContainer.js @@ -1,16 +1,14 @@ // @flow import type { Node } from 'react'; +import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; +import type { InjectedOrGenerated } from '../../../types/injectedPropsType'; import { Component } from 'react'; import { computed, action, observable } from 'mobx'; import { observer } from 'mobx-react'; import { defineMessages, intlShape } from 'react-intl'; -import globalMessages from '../../../i18n/global-messages'; import { messages } from '../../../components/wallet/settings/ResyncBlock'; import { PublicDeriver } from '../../../api/ada/lib/storage/models/PublicDeriver/index'; -import type { $npm$ReactIntl$IntlFormat } from 'react-intl'; - -import type { InjectedOrGenerated } from '../../../types/injectedPropsType'; - +import globalMessages from '../../../i18n/global-messages'; import DangerousActionDialog from '../../../components/widgets/DangerousActionDialog'; import LocalizableError from '../../../i18n/LocalizableError'; @@ -24,13 +22,14 @@ type Props = {| const dialogMessages = defineMessages({ warning: { id: 'wallet.settings.resync.warning', - defaultMessage: '!!!This will also cause failed transactions to disappear as they are not stored on the blockchain.', + defaultMessage: + '!!!This will also cause failed transactions to disappear as they are not stored on the blockchain.', }, }); @observer export default class ResyncWalletDialogContainer extends Component { - static contextTypes: {|intl: $npm$ReactIntl$IntlFormat|} = { + static contextTypes: {| intl: $npm$ReactIntl$IntlFormat |} = { intl: intlShape.isRequired, }; @@ -44,7 +43,7 @@ export default class ResyncWalletDialogContainer extends Component { toggleCheck: void => void = () => { if (this.generated.stores.walletSettings.clearHistory.isExecuting) return; this.isChecked = !this.isChecked; - } + }; render(): Node { const { intl } = this.context; @@ -60,16 +59,17 @@ export default class ResyncWalletDialogContainer extends Component { error={settingsStore.clearHistory.error} primaryButton={{ label: intl.formatMessage(globalMessages.resyncButtonLabel), + danger: false, onClick: async () => { await this.generated.actions.walletSettings.resyncHistory.trigger({ publicDeriver: this.props.publicDeriver, }); this.generated.actions.dialogs.closeActiveDialog.trigger(); - } + }, }} onCancel={this.generated.actions.dialogs.closeActiveDialog.trigger} secondaryButton={{ - onClick: this.generated.actions.dialogs.closeActiveDialog.trigger + onClick: this.generated.actions.dialogs.closeActiveDialog.trigger, }} >

    {intl.formatMessage(messages.resyncExplanation)}

    @@ -82,27 +82,27 @@ export default class ResyncWalletDialogContainer extends Component { actions: {| dialogs: {| closeActiveDialog: {| - trigger: (params: void) => void - |} + trigger: (params: void) => void, + |}, |}, walletSettings: {| resyncHistory: {| trigger: (params: {| - publicDeriver: PublicDeriver<> - |}) => Promise - |} - |} + publicDeriver: PublicDeriver<>, + |}) => Promise, + |}, + |}, |}, stores: {| walletSettings: {| clearHistory: {| error: ?LocalizableError, isExecuting: boolean, - reset: () => void - |} - |} - |} - |} { + reset: () => void, + |}, + |}, + |}, + |} { if (this.props.generated !== undefined) { return this.props.generated; } diff --git a/packages/yoroi-extension/app/containers/wallet/dialogs/RevampAnnouncementDialog.js b/packages/yoroi-extension/app/containers/wallet/dialogs/RevampAnnouncementDialog.js index 96f6752ba6..898c136379 100644 --- a/packages/yoroi-extension/app/containers/wallet/dialogs/RevampAnnouncementDialog.js +++ b/packages/yoroi-extension/app/containers/wallet/dialogs/RevampAnnouncementDialog.js @@ -2,7 +2,7 @@ import { Component } from 'react'; import type { Node } from 'react'; -import DialogRevamp from '../../../components/widgets/DialogRevamp'; +import Dialog from '../../../components/widgets/Dialog'; import { defineMessages, intlShape } from 'react-intl'; import { observer } from 'mobx-react'; import { ReactComponent as NewThemeIllustration } from '../../../assets/images/new-theme-illustration.inline.svg'; @@ -76,22 +76,14 @@ export class RevampAnnouncementDialog extends Component { }, ]; return ( - } actions={actions} > - + { - + ); } } diff --git a/packages/yoroi-extension/app/containers/wallet/dialogs/RevampAnnouncementDialog.scss b/packages/yoroi-extension/app/containers/wallet/dialogs/RevampAnnouncementDialog.scss index 955e3e45d6..4d2aa1d88c 100644 --- a/packages/yoroi-extension/app/containers/wallet/dialogs/RevampAnnouncementDialog.scss +++ b/packages/yoroi-extension/app/containers/wallet/dialogs/RevampAnnouncementDialog.scss @@ -1,19 +1,3 @@ .dialog { - padding-top: 25px; - padding-bottom: 24px; - max-width: 650px !important; - - & > h1 { - margin-bottom: 25px !important; - } - - & > div { - padding: 0px 24px !important; - } - - & > div:nth-child(3) { - margin-top: 27px !important; - padding-left: 24px !important; - padding-right: 24px !important; - } + max-width: 648px !important; } diff --git a/packages/yoroi-extension/app/containers/wallet/staking/WithdrawRewardsDialog.js b/packages/yoroi-extension/app/containers/wallet/staking/WithdrawRewardsDialog.js index 0a60f59061..1eb1b6210d 100644 --- a/packages/yoroi-extension/app/containers/wallet/staking/WithdrawRewardsDialog.js +++ b/packages/yoroi-extension/app/containers/wallet/staking/WithdrawRewardsDialog.js @@ -22,9 +22,16 @@ import type { NetworkRow, TokenRow } from '../../../api/ada/lib/storage/database import type { ISignRequest } from '../../../api/common/lib/transactions/ISignRequest'; import type { SelectedExplorer } from '../../../domain/SelectedExplorer'; import type { SendUsingTrezorParams } from '../../../actions/ada/trezor-send-actions'; -import { genFormatTokenAmount, genLookupOrFail, getTokenName, } from '../../../stores/stateless/tokenHelpers'; +import { + genFormatTokenAmount, + genLookupOrFail, + getTokenName, +} from '../../../stores/stateless/tokenHelpers'; import ReactToolboxMobxForm from '../../../utils/ReactToolboxMobxForm'; -import { isLedgerNanoWallet, isTrezorTWallet, } from '../../../api/ada/lib/storage/models/ConceptualWallet'; +import { + isLedgerNanoWallet, + isTrezorTWallet, +} from '../../../api/ada/lib/storage/models/ConceptualWallet'; import { asGetSigningKey } from '../../../api/ada/lib/storage/models/PublicDeriver/traits'; import SpendingPasswordInput from '../../../components/widgets/forms/SpendingPasswordInput'; import VerticallyCenteredLayout from '../../../components/layout/VerticallyCenteredLayout'; @@ -34,7 +41,7 @@ import YoroiTransferErrorPage from '../../transfer/YoroiTransferErrorPage'; import ExplorableHashContainer from '../../widgets/ExplorableHashContainer'; import RawHash from '../../../components/widgets/hashWrappers/RawHash'; import Warning from '../../../components/common/Warning'; -import DialogRevamp from '../../../components/widgets/DialogRevamp'; +import Dialog from '../../../components/widgets/Dialog'; import { PublicDeriver } from '../../../api/ada/lib/storage/models/PublicDeriver'; import type { SendUsingLedgerParams } from '../../../actions/ada/ledger-send-actions'; import LocalizableError from '../../../i18n/LocalizableError'; @@ -215,7 +222,7 @@ export default class WithdrawRewardsDialog extends Component { const tentativeTx = createWithdrawalTx.result; if (!tentativeTx) return ( - @@ -226,7 +233,7 @@ export default class WithdrawRewardsDialog extends Component { - + ); const receivers = tentativeTx.receivers(true); const receiverAddress = addressToDisplayString(receivers[0], network); @@ -258,7 +265,7 @@ export default class WithdrawRewardsDialog extends Component { if (!selectedExplorer) throw new Error('No explorer for wallet network'); return ( - { closeOnOverlayClick={false} onClose={this.props.onClose} closeButton={} + scrollableContentClass="WithdrawRewards" + styleOverride={{ width: '648px' }} > - + {shouldDeregister && ( @@ -413,7 +422,7 @@ export default class WithdrawRewardsDialog extends Component { ) : null} - + ); } diff --git a/packages/yoroi-extension/app/i18n/global-messages.js b/packages/yoroi-extension/app/i18n/global-messages.js index 2c5132610a..a1d723bbdb 100644 --- a/packages/yoroi-extension/app/i18n/global-messages.js +++ b/packages/yoroi-extension/app/i18n/global-messages.js @@ -84,6 +84,10 @@ const globalMessages: * = defineMessages({ id: 'wallet.nav.type.ledger', defaultMessage: '!!!Ledger wallet', }, + important: { + id: 'global.dialogs.important', + defaultMessage: '!!!Important', + }, fieldIsRequired: { id: 'global.errors.fieldIsRequired', defaultMessage: '!!!This field is required.', diff --git a/packages/yoroi-extension/app/i18n/locales/en-US.json b/packages/yoroi-extension/app/i18n/locales/en-US.json index c80cd1607a..ff4e808fa2 100644 --- a/packages/yoroi-extension/app/i18n/locales/en-US.json +++ b/packages/yoroi-extension/app/i18n/locales/en-US.json @@ -191,6 +191,7 @@ "global.language.spanish": "EspaƱol", "global.language.turkish": "Turkish", "global.language.vietnamese": "Vietnamese", + "global.dialogs.important": "Important", "global.ok": "Ok", "global.passwordInstructionsPaperWallet": "Note: Paper Wallet password needs to be at least 10 characters long.", "global.publicKey.explanation": "Public keys allow seeing the wallet history for the wallet, but does not allow to spend or move the funds in any way (private key is not included)", @@ -1074,4 +1075,4 @@ "yoroiTransfer.waiting.progressInfo.checkingAddresses": "Checking addresses funds", "yoroiTransfer.waiting.progressInfo.restoringAddresses": "Fetching addresses", "yoroiTransfer.waiting.title.label": "Wallet is being restored" -} \ No newline at end of file +} diff --git a/packages/yoroi-extension/package-lock.json b/packages/yoroi-extension/package-lock.json index d3f5aca9d8..bf76a683c3 100644 --- a/packages/yoroi-extension/package-lock.json +++ b/packages/yoroi-extension/package-lock.json @@ -1,6 +1,6 @@ { "name": "yoroi", - "version": "4.23.101", + "version": "4.23.102", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/yoroi-extension/package.json b/packages/yoroi-extension/package.json index 39df562866..342a156be9 100644 --- a/packages/yoroi-extension/package.json +++ b/packages/yoroi-extension/package.json @@ -1,6 +1,6 @@ { "name": "yoroi", - "version": "4.23.101", + "version": "4.23.102", "description": "Cardano ADA wallet", "scripts": { "dev-mv2": "rimraf dev/ && babel-node scripts-mv2/build --type=debug --env 'mainnet'",