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 {render} from 'react-dom'; | |
import DataActions from 'flux/actions/DataActions.js'; | |
import Home from 'components/Home.js'; | |
import About from 'components/About.js'; | |
import Header from 'components/Header.js'; | |
import { | |
BrowserRouter as Router, | |
Route, |
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 {Link} from 'react-router-dom'; | |
import DataStore from 'flux/stores/DataStore.js' | |
class Header extends React.Component { | |
render() { | |
let allPages = DataStore.getAllPages(); | |
allPages = _.sortBy(allPages, [function(page) { return page.menu_order; }]); // Sort pages by order | |
return ( |
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 {render} from 'react-dom'; | |
import DataActions from 'flux/actions/DataActions.js'; | |
import Home from 'components/Home.js'; | |
import About from 'components/About.js'; | |
import { | |
BrowserRouter as Router, | |
Route, | |
Redirect, | |
Switch |
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 {render} from 'react-dom'; | |
import DataActions from 'flux/actions/DataActions.js'; | |
import Home from 'components/Home.js'; | |
import { | |
BrowserRouter as Router, | |
Route, | |
Redirect, | |
Switch | |
} from 'react-router-dom'; |
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 DataStore from 'flux/stores/DataStore.js' | |
class Home extends React.Component { | |
render() { | |
let allData = DataStore.getAll(); | |
console.log(allData); | |
return ( | |
<div> | |
<h2>Hello world!</h2> |
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 {render} from 'react-dom'; | |
import DataActions from 'flux/actions/DataActions.js'; | |
import Home from 'components/Home.js'; | |
import { | |
BrowserRouter as Router, | |
Route, | |
Redirect, | |
Switch | |
} from 'react-router-dom'; |
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 alt from 'flux/alt/alt.js'; | |
import DataActions from 'flux/actions/DataActions.js'; | |
class DataStore { | |
constructor() { | |
this.data = {}; | |
this.bindListeners({ | |
// Listen to the getSuccess() in DataActions.js | |
handleSuccess: DataActions.GET_SUCCESS |
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 axios from 'axios'; | |
import alt from 'flux/alt/alt.js'; | |
class DataActions { | |
constructor() { | |
const appUrl = 'http://wordpress-installation-example-url.com'; // Wordpress installation url | |
this.pagesEndPoint = `${appUrl}/wp-json/wp/v2/pages`; // Endpoint for getting Wordpress Pages | |
this.postsEndPoint = `${appUrl}/wp-json/wp/v2/posts`; // Endpoint for getting Wordpress Posts |
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
class Home extends React.Component { | |
render() { | |
return ( | |
<div> | |
<h2>Hello world!</h2> | |
</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 {render} from 'react-dom'; | |
import Home from 'components/Home.js'; | |
import { | |
BrowserRouter as Router, | |
Route, | |
Redirect, | |
Switch | |
} from 'react-router-dom'; |
NewerOlder