Added Articles and Article Components
This commit is contained in:
parent
57d0831de7
commit
ca6585307b
File diff suppressed because it is too large
Load Diff
|
|
@ -3,6 +3,8 @@ import { BrowserRouter, Route, Switch } from 'react-router-dom';
|
|||
import "./css/App.css";
|
||||
import Navigation from './Navigation';
|
||||
import Github from './Github';
|
||||
import Articles from './Articles';
|
||||
import Article from './Article';
|
||||
import About from './About';
|
||||
import Intro from './Intro';
|
||||
|
||||
|
|
@ -16,6 +18,7 @@ const App = (props) => {
|
|||
<Route path="/" exact component={Intro} />
|
||||
<Route path="/github" render={(props) => <Github {...props} />} />
|
||||
<Route path="/about" component={About} />
|
||||
<Route path="/articles" component={Articles} />
|
||||
</Switch>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
import React from 'react';
|
||||
import './css/Articles.css';
|
||||
|
||||
const Article = ({match}) => {
|
||||
return (
|
||||
<div>
|
||||
"Article: " {match}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Article;
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import React from 'react';
|
||||
import './css/Articles.css';
|
||||
import Theater from './subcomponents/Theater';
|
||||
import Article from './Article';
|
||||
import { Route, Link } from 'react-router-dom';
|
||||
|
||||
|
||||
class Articles extends React.Component {
|
||||
/**
|
||||
* Articles -
|
||||
*/
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
document.title = "Articles";
|
||||
|
||||
}
|
||||
|
||||
renderArticles() {
|
||||
|
||||
return (
|
||||
<div>
|
||||
"Articles"
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
article(match) {
|
||||
return (
|
||||
<div>
|
||||
{match.params.id}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<div className="Articles">
|
||||
<Theater
|
||||
title="Articles"
|
||||
description="Self written articles to help share information I've learned in the past."
|
||||
extraClasses="h-50v"
|
||||
/>
|
||||
<Route path="/articles/:id" render={({match})=>{return this.article(match)}} />
|
||||
{this.renderArticles()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default Articles;
|
||||
Loading…
Reference in New Issue