mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +01:00
move footer buttons to scrollable area (#9228)
Co-authored-by: Patryk Łucka <patryk.lucka@consensys.net>
This commit is contained in:
parent
d5948f1cbe
commit
f7e4e209ef
@ -4,6 +4,8 @@ import classnames from 'classnames'
|
|||||||
import { Tabs, Tab } from '../../../ui/tabs'
|
import { Tabs, Tab } from '../../../ui/tabs'
|
||||||
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'
|
import { ConfirmPageContainerSummary, ConfirmPageContainerWarning } from '.'
|
||||||
import ErrorMessage from '../../../ui/error-message'
|
import ErrorMessage from '../../../ui/error-message'
|
||||||
|
import { PageContainerFooter } from '../../../ui/page-container'
|
||||||
|
|
||||||
|
|
||||||
export default class ConfirmPageContainerContent extends Component {
|
export default class ConfirmPageContainerContent extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -22,6 +24,15 @@ export default class ConfirmPageContainerContent extends Component {
|
|||||||
title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
titleComponent: PropTypes.node,
|
titleComponent: PropTypes.node,
|
||||||
warning: PropTypes.string,
|
warning: PropTypes.string,
|
||||||
|
// Footer
|
||||||
|
onCancelAll: PropTypes.func,
|
||||||
|
onCancel: PropTypes.func,
|
||||||
|
cancelText: PropTypes.string,
|
||||||
|
onSubmit: PropTypes.func,
|
||||||
|
submitText: PropTypes.string,
|
||||||
|
disabled: PropTypes.bool,
|
||||||
|
unapprovedTxCount: PropTypes.number,
|
||||||
|
rejectNText: PropTypes.string,
|
||||||
}
|
}
|
||||||
|
|
||||||
renderContent () {
|
renderContent () {
|
||||||
@ -66,6 +77,14 @@ export default class ConfirmPageContainerContent extends Component {
|
|||||||
detailsComponent,
|
detailsComponent,
|
||||||
dataComponent,
|
dataComponent,
|
||||||
warning,
|
warning,
|
||||||
|
onCancelAll,
|
||||||
|
onCancel,
|
||||||
|
cancelText,
|
||||||
|
onSubmit,
|
||||||
|
submitText,
|
||||||
|
disabled,
|
||||||
|
unapprovedTxCount,
|
||||||
|
rejectNText,
|
||||||
} = this.props
|
} = this.props
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -104,6 +123,21 @@ export default class ConfirmPageContainerContent extends Component {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
<PageContainerFooter
|
||||||
|
onCancel={onCancel}
|
||||||
|
cancelText={cancelText}
|
||||||
|
onSubmit={onSubmit}
|
||||||
|
submitText={submitText}
|
||||||
|
submitButtonType="confirm"
|
||||||
|
disabled={disabled}
|
||||||
|
>
|
||||||
|
{unapprovedTxCount > 1 && (
|
||||||
|
<a onClick={onCancelAll}>
|
||||||
|
{rejectNText}
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
|
</PageContainerFooter>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
&__error-container {
|
&__error-container {
|
||||||
padding: 0 16px 16px 16px;
|
padding: 0 16px 16px 16px;
|
||||||
@ -72,4 +74,8 @@
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
margin: 0 8px;
|
margin: 0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-container__footer {
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,23 +157,35 @@ export default class ConfirmPageContainer extends Component {
|
|||||||
nonce={nonce}
|
nonce={nonce}
|
||||||
assetImage={assetImage}
|
assetImage={assetImage}
|
||||||
warning={warning}
|
warning={warning}
|
||||||
|
onCancelAll={onCancelAll}
|
||||||
|
onCancel={onCancel}
|
||||||
|
cancelText={this.context.t('reject')}
|
||||||
|
onSubmit={onSubmit}
|
||||||
|
submitText={this.context.t('confirm')}
|
||||||
|
disabled={disabled}
|
||||||
|
unapprovedTxCount={unapprovedTxCount}
|
||||||
|
rejectNText={this.context.t('rejectTxsN', [unapprovedTxCount])}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
contentComponent && (
|
||||||
<PageContainerFooter
|
<PageContainerFooter
|
||||||
onCancel={() => onCancel()}
|
onCancel={onCancel}
|
||||||
cancelText={this.context.t('reject')}
|
cancelText={this.context.t('reject')}
|
||||||
onSubmit={() => onSubmit()}
|
onSubmit={onSubmit}
|
||||||
submitText={this.context.t('confirm')}
|
submitText={this.context.t('confirm')}
|
||||||
submitButtonType="confirm"
|
submitButtonType="confirm"
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
>
|
>
|
||||||
{unapprovedTxCount > 1 && (
|
{unapprovedTxCount > 1 && (
|
||||||
<a onClick={() => onCancelAll()}>
|
<a onClick={onCancelAll}>
|
||||||
{this.context.t('rejectTxsN', [unapprovedTxCount])}
|
{this.context.t('rejectTxsN', [unapprovedTxCount])}
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
</PageContainerFooter>
|
</PageContainerFooter>
|
||||||
|
)
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user