2018-04-07 00:29:51 +02:00
|
|
|
import React, { Component } from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
2018-05-15 13:43:39 +02:00
|
|
|
import Button from '../../button'
|
2018-04-07 00:29:51 +02:00
|
|
|
|
|
|
|
export default class PageContainerFooter extends Component {
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
onCancel: PropTypes.func,
|
2018-04-11 00:28:52 +02:00
|
|
|
cancelText: PropTypes.string,
|
2018-04-07 00:29:51 +02:00
|
|
|
onSubmit: PropTypes.func,
|
2018-04-11 00:28:52 +02:00
|
|
|
submitText: PropTypes.string,
|
2018-04-07 00:29:51 +02:00
|
|
|
disabled: PropTypes.bool,
|
2018-04-11 00:28:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static contextTypes = {
|
|
|
|
t: PropTypes.func,
|
|
|
|
}
|
2018-04-07 00:29:51 +02:00
|
|
|
|
|
|
|
render () {
|
2018-04-11 00:28:52 +02:00
|
|
|
const {
|
|
|
|
onCancel,
|
|
|
|
cancelText,
|
|
|
|
onSubmit,
|
|
|
|
submitText,
|
|
|
|
disabled,
|
|
|
|
} = this.props
|
2018-04-07 00:29:51 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="page-container__footer">
|
|
|
|
|
2018-05-14 15:30:50 +02:00
|
|
|
<Button
|
|
|
|
type="secondary"
|
|
|
|
large={true}
|
|
|
|
className="page-container__footer-button"
|
2018-04-07 00:29:51 +02:00
|
|
|
onClick={() => onCancel()}
|
|
|
|
>
|
2018-05-24 22:55:23 +02:00
|
|
|
{ cancelText || this.context.t('cancel') }
|
2018-05-14 15:30:50 +02:00
|
|
|
</Button>
|
2018-04-07 00:29:51 +02:00
|
|
|
|
2018-05-14 15:30:50 +02:00
|
|
|
<Button
|
|
|
|
type="primary"
|
|
|
|
large={true}
|
|
|
|
className="page-container__footer-button"
|
2018-04-07 00:29:51 +02:00
|
|
|
disabled={disabled}
|
2018-04-11 00:28:52 +02:00
|
|
|
onClick={e => onSubmit(e)}
|
2018-04-07 00:29:51 +02:00
|
|
|
>
|
2018-05-24 22:55:23 +02:00
|
|
|
{ submitText || this.context.t('next') }
|
2018-05-14 15:30:50 +02:00
|
|
|
</Button>
|
2018-04-07 00:29:51 +02:00
|
|
|
|
|
|
|
</div>
|
2018-04-11 00:28:52 +02:00
|
|
|
)
|
2018-04-07 00:29:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|