Added Articles and Article Components

This commit is contained in:
Camerin Figueroa 2021-10-25 16:46:16 -04:00
parent 57d0831de7
commit ca6585307b
5 changed files with 1322 additions and 1959 deletions

3213
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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>

12
src/components/Article.js Normal file
View File

@ -0,0 +1,12 @@
import React from 'react';
import './css/Articles.css';
const Article = ({match}) => {
return (
<div>
"Article: " {match}
</div>
);
}
export default Article;

View File

@ -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;

View File