{"id":275,"date":"2019-10-04T05:47:21","date_gmt":"2019-10-04T05:47:21","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/reactify\/?page_id=275"},"modified":"2019-10-10T08:21:16","modified_gmt":"2019-10-10T08:21:16","slug":"dialogs","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/reactify\/dialogs\/","title":{"rendered":"Dialogs"},"content":{"rendered":"\n<p>You can add the component on any page in the template. You need to follow the steps given below: \u200c<\/p>\n\n\n\n<p><strong>Step 1:<\/strong> You need to create a state and functions to handle it&#8217;s events. Also you need to add the code of dialog in the page where you want to add the component. Please check the code snippet given below, we have added the dialog in the Ecommerce Dashboard:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/**<br> * Ecommerce Dashboard<br> *\/<br> <br>import React, { Component } from 'react'<br>...<br> <br>export default class EcommerceDashboard extends Component {<br>    <br>   \/\/ Dialog state<br>   state = {<br>      open: false<br>   }<br> <br>   \/\/ Dialog Functions<br>   handleClickOpen() {<br>      this.setState({ open: true });<br>   };<br> <br>   handleClose() {<br>      this.setState({ open: false });<br>   };<br> render() {<br>      ...<br>      &lt;div className=\"col-sm-6 col-md-12 mb-30\"><br>        \/\/ Dialog Code<br>       &lt;div><br>          &lt;Button variant=\"contained\" onClick={() => this.handleClickOpen()} color=\"primary\" className=\"text-white\">Open alert dialog&lt;\/Button><br>          &lt;Dialog open={this.state.open} onClose={() => this.handleClose()} aria-labelledby=\"alert-dialog-title\" aria-describedby=\"alert-dialog-description\"><br>             &lt;DialogTitle id=\"alert-dialog-title\">{\"Use Google's location service?\"}&lt;\/DialogTitle><br>             &lt;DialogContent><br>                 &lt;DialogContentText id=\"alert-dialog-description\">Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.&lt;\/DialogContentText><br>             &lt;\/DialogContent><br>             &lt;DialogActions><br>                &lt;Button variant=\"contained\" onClick={() => this.handleClose()} className=\"btn-danger text-white\"> Disagree &lt;\/Button><br>                &lt;Button variant=\"contained\" onClick={() => this.handleClose()} color=\"primary\" className=\"text-white\" autoFocus> Agree &lt;\/Button><br>             &lt;\/DialogActions><br>         &lt;\/Dialog><br>       &lt;\/div><br>     &lt;\/div><br>     ... <\/pre>\n\n\n\n<p><strong>Step 2:<\/strong> Now Import the component from its parent library.Add filenamePlain Text <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import Button from '@material-ui\/core\/Button';<br>import Dialog from '@material-ui\/core\/Dialog';<br>import DialogActions from '@material-ui\/core\/DialogActions';<br>import DialogContent from '@material-ui\/core\/DialogContent';<br>import DialogContentText from '@material-ui\/core\/DialogContentText';<br>import DialogTitle from '@material-ui\/core\/DialogTitle';<\/pre>\n\n\n\n<p>We have given you an example of adding a simple dialog on the Ecommerce Dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"175\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog-1024x175.png\" alt=\"\" class=\"wp-image-476\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog-1024x175.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog-300x51.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog-768x131.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog.png 1305w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption><br><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"390\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog2-1024x390.png\" alt=\"\" class=\"wp-image-477\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog2-1024x390.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog2-300x114.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog2-768x293.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog2.png 1309w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>You can check some other layouts of dialogs below. For adding any of the below layout in the template, please check their relative code in the <code>src->routes->components->dialog->component<\/code> folder.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"1024\" height=\"284\" src=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog3-1024x284.png\" alt=\"\" class=\"wp-image-478\" srcset=\"https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog3-1024x284.png 1024w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog3-300x83.png 300w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog3-768x213.png 768w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog3-1568x435.png 1568w, https:\/\/docs.theironnetwork.org\/reactify\/wp-content\/uploads\/sites\/4\/2019\/10\/dialog3.png 1615w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-like-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"275\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-ip-check=\"0\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                    <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">1    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-dislike-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"275\" data-trigger-type=\"dislike\" data-ip-check=\"0\" data-restriction=\"cookie\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                    <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>You can add the component on any page in the template. You need to follow the steps given below: \u200c Step 1: You need to create a state and functions to handle it&#8217;s events. Also you need to add the code of dialog in the page where you want to add the component. Please check [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":23,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/275"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/comments?post=275"}],"version-history":[{"count":2,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/275\/revisions"}],"predecessor-version":[{"id":479,"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/pages\/275\/revisions\/479"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/reactify\/wp-json\/wp\/v2\/media?parent=275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}