diff --git a/examples/basic/app.js b/examples/basic/app.js index 323f4d90..bb3b1c20 100644 --- a/examples/basic/app.js +++ b/examples/basic/app.js @@ -1,88 +1,36 @@ import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import Modal from '../../src/index'; +import ViewA from './view_a'; +import ViewB from './view_b'; const appElement = document.getElementById('example'); Modal.setAppElement('#example'); +const heading = firstView => { + if (firstView) { + return "#1. Working with one modal at a time."; + } + return "#2. Working with many modal."; +}; + class App extends Component { constructor(props) { super(props); - this.state = { modal1: false, modal2: false }; - } - - toggleModal_1 = () => { - this.setState({ ...this.state, modal1: !this.state.modal1 }); - } - - toggleModal_2 = event => { - event.preventDefault(); - this.setState({ ...this.state, modal2: !this.state.modal2 }); - } - - handleModalCloseRequest = () => { - // opportunity to validate something and keep the modal open even if it - // requested to be closed - this.setState({ ...this.state, modal1: false }); - } - - handleInputChange = () => { - this.setState({ ...this.state, foo: 'bar' }); + this.state = { firstView: true }; } - handleOnAfterOpenModal = () => { - // when ready, we can access the available refs. - this.refs.title.style.color = '#F00'; + toggleView = () => { + this.setState({ ...this.state, firstView: !this.state.firstView }); } render() { - const { modal1, modal2 } = this.state; return (
This is a description of what it does: nothing :)
-This is a description of what it does: nothing :)
+Loading...
+ ) : ( +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur pulvinar varius auctor. Aliquam maximus et justo ut faucibus. Nullam sit amet urna molestie turpis bibendum accumsan a id sem. Proin ullamcorper nisl sapien, gravida dictum nibh congue vel. Vivamus convallis dolor vitae ipsum ultricies, vitae pulvinar justo tincidunt. Maecenas a nunc elit. Phasellus fermentum, tellus ut consectetur scelerisque, eros nunc lacinia eros, aliquet efficitur tellus arcu a nibh. Praesent quis consequat nulla. Etiam dapibus ac sem vel efficitur. Nunc faucibus efficitur leo vitae vulputate. Nunc at quam vitae felis pretium vehicula vel eu quam. Quisque sapien mauris, condimentum eget dictum ut, congue id dolor. Donec vitae varius orci, eu faucibus turpis. Morbi eleifend orci non urna bibendum, ac scelerisque augue efficitur.
+ +Maecenas justo justo, laoreet vitae odio quis, lacinia porttitor arcu. Nunc nisl est, ultricies sed laoreet eu, semper in nisi. Phasellus lacinia porta purus, eu luctus neque. Nullam quis mi malesuada, vestibulum sem id, rhoncus purus. Aliquam erat volutpat. Duis nec turpis mi. Pellentesque eleifend nisl sed risus aliquet, eu feugiat elit auctor. Suspendisse ac neque vitae ligula consequat aliquam. Vivamus sit amet eros et ante mollis porta.
+