This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from "react"; | |
| import { render } from "react-dom"; | |
| import { BrowserRouter as Router, Route } from "react-router-dom"; | |
| import { LocalizeProvider } from "react-localize-redux"; | |
| import Main from "./Main"; | |
| const App = props => ( | |
| <LocalizeProvider> | |
| <Router> | |
| <Route path="/" component={Main} /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| const ToggleRadio = props => { | |
| const { heading, group, radio1, radio2 } = props; | |
| return ( | |
| <div> | |
| <fieldset> | |
| <legend>{ heading }</legend> | |
| <input id={ radio1.id } name={ group } value={ radio1.value } type="radio" /> | |
| <label for={ radio1.id }>{ radio1.label }</label> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { connect } from 'react-redux'; | |
| import Alert from 'components/Alert'; | |
| import Modal from 'components/Modal'; | |
| const mapStateToProps = state => ({ | |
| isOpen: state.modals.isAlertOpen, | |
| children: React.createElement(Alert) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { connect } from 'react-redux'; | |
| import ImageCarousel from 'components/ImageCarousel'; | |
| import Modal from 'components/Modal'; | |
| const mapStateToProps = state => ({ | |
| isOpen: state.modals.isImageModalOpen, | |
| children: React.createElement(ImageCarousel, { images: state.images }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { connect } from 'react-redux'; | |
| import Spinner from 'components/Spinner'; | |
| const mapStateToProps = state => ({ isSpinning: state.isArticleSubmitting }); | |
| export default connect(mapStateToProps)(Spinner); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { connect } from 'react-redux'; | |
| import Spinner from 'components/Spinner'; | |
| const mapStateToProps = state => ({ isSpinning: state.isFetchingArticles }); | |
| export default connect(mapStateToProps)(Spinner); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| const Spinner = props => { | |
| const { isSpinning } = props; | |
| renderSpinner = ( | |
| <div className="spinner"> | |
| <div className="double-bounce1"></div> | |
| <div className="double-bounce2"></div> | |
| </div> | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| const Modal = props => { | |
| const { isOpen, children } = props; | |
| const renderModal = ( | |
| <div className="blocker"> | |
| <div className="content"> | |
| { children } | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import webpack from 'webpack'; | |
| import { resolve } from 'path'; | |
| import HtmlWebpackPlugin from 'html-webpack-plugin'; | |
| import ProgressBarPlugin from 'progress-bar-webpack-plugin'; | |
| import ExtractTextPlugin from 'extract-text-webpack-plugin'; | |
| import CopyWebpackPlugin from 'copy-webpack-plugin'; | |
| import combineLoaders from 'webpack-combine-loaders'; | |
| import { getIfUtils, removeEmpty } from 'webpack-config-utils'; | |
| import autoprefixer from 'autoprefixer'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // NOTE: This is not a complete config file, just a partial file for example | |
| import webpack from 'webpack'; | |
| import { getIfUtils, removeEmpty } from 'webpack-config-utils'; | |
| export default env => { | |
| const { ifProd, ifNotProd } = getIfUtils(env); | |
| return { | |
| cache: ifProd(), | |
| // ------------------------------------ | |
| // Entry Points |