implemented the modal
This commit is contained in:
11
src/components/UI/Backdrop/Backdrop.js
Normal file
11
src/components/UI/Backdrop/Backdrop.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
|
||||
|
||||
|
||||
const backdrop = (props) => (
|
||||
props.show ? <div
|
||||
onClick={props.toggleBackdrop}
|
||||
className="backdrop"></div> : null
|
||||
);
|
||||
|
||||
export default backdrop;
|
||||
15
src/components/UI/Modal/Modal.js
Normal file
15
src/components/UI/Modal/Modal.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import React from 'react';
|
||||
import Aux from '../../../hoc/Aux/Aux';
|
||||
import Backdrop from '../Backdrop/Backdrop'
|
||||
|
||||
const modal = (props) => (
|
||||
<Aux>
|
||||
<Backdrop show={props.show} toggleBackdrop={props.modalClosed}/>
|
||||
<div
|
||||
className={"modal " + (props.show ? "show" : "hide")}>
|
||||
{props.children}
|
||||
</div>
|
||||
</Aux>
|
||||
);
|
||||
|
||||
export default modal;
|
||||
Reference in New Issue
Block a user