Add post container, component and route
This commit is contained in:
parent
a026c1f321
commit
e642c81472
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Route, Switch } from 'react-router-dom';
|
import { Route, Switch } from 'react-router-dom';
|
||||||
import { Home, About, Portfolio, Resume, NotFoundPage } from '.';
|
import { Home, About, Portfolio, Resume, NotFoundPage } from '.';
|
||||||
import { BlogContainer } from '../containers';
|
import { BlogContainer, PostContainer } from '../containers';
|
||||||
|
|
||||||
export const App = () => (
|
export const App = () => (
|
||||||
<div>
|
<div>
|
||||||
|
@ -9,6 +9,7 @@ export const App = () => (
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path="/about" component={About} />
|
<Route exact path="/about" component={About} />
|
||||||
<Route exact path="/blog" component={BlogContainer} />
|
<Route exact path="/blog" component={BlogContainer} />
|
||||||
|
<Route path="/blog/post/:postname" component={PostContainer} />
|
||||||
<Route exact path="/portfolio" component={Portfolio} />
|
<Route exact path="/portfolio" component={Portfolio} />
|
||||||
<Route exact path="/resume" component={Resume} />
|
<Route exact path="/resume" component={Resume} />
|
||||||
<Route component={NotFoundPage} />
|
<Route component={NotFoundPage} />
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
import React, {Component} from 'react';
|
||||||
|
|
||||||
|
export default class Post extends Component {
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<div>Hello</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
import React, {Component} from 'react';
|
||||||
|
import axios from 'axios';
|
||||||
|
import {Post} from '../components';
|
||||||
|
|
||||||
|
export default class PostContainer extends Component {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
isLoading: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<Post isLoading={this.state.isLoading}
|
||||||
|
post={this.state.post} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue