43 lines
1.0 KiB
JavaScript
43 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import { Modal, Button, Row, Col } from 'react-materialize';
|
|
|
|
const YesNoModal = (props) => {
|
|
const { title, body, yesAction, noAction, triggerNode } = props;
|
|
return(
|
|
<Modal
|
|
actions={[
|
|
<Row>
|
|
<Col s={3}>
|
|
<Button modal="confirm" node="button" waves="green" onClick={yesAction}>Yes</Button>
|
|
</Col>
|
|
<Col s={3}>
|
|
<Button modal="close" node="button" waves="red" onClick={noAction}>No</Button>
|
|
</Col>
|
|
</Row>
|
|
]}
|
|
bottomSheet
|
|
fixedFooter={false}
|
|
header={title}
|
|
id="Modal-0"
|
|
open={false}
|
|
options={{
|
|
dismissible: true,
|
|
endingTop: '10%',
|
|
inDuration: 250,
|
|
onCloseEnd: null,
|
|
onCloseStart: null,
|
|
onOpenEnd: null,
|
|
onOpenStart: null,
|
|
opacity: 0.5,
|
|
outDuration: 250,
|
|
preventScrolling: true,
|
|
startingTop: '4%'
|
|
}}
|
|
trigger={triggerNode}
|
|
>
|
|
<p>{body}</p>
|
|
</Modal>
|
|
)
|
|
}
|
|
|
|
export default YesNoModal; |