1
0
Fork 0

Add about page

This commit is contained in:
Amarpreet Minhas 2019-07-27 20:24:05 -04:00
parent 9ab288daee
commit 65a5822926
3 changed files with 28 additions and 7 deletions

View file

@ -1,11 +1,26 @@
import React from 'react'
import React from 'react';
import ReactMarkdown from 'react-markdown';
import AboutMarkdown from '../static/about.md';
import { connect } from 'react-redux';
const About () => {
class About extends React.Component {
constructor () {
super();
this.state = { about: '' };
}
componentWillMount() {
fetch(AboutMarkdown).then(res => res.text()).then(text => this.setState({ markdown: text }));
}
render () {
const { markdown } = this.state;
return (
<div className="container">
<h4 className="center">About</h4>
<div className="content">
<ReactMarkdown source={markdown }/>
</div>
)
);
}
}
export default About;

View file

@ -4,6 +4,7 @@ import NavBar from './NavBar';
import PostList from './PostList';
import Post from './Post';
import User from './User';
import About from './About'
function App() {
return (
@ -12,6 +13,7 @@ function App() {
<NavBar/>
<Switch>
<Route exact path="/" component={PostList}/>
<Route exact path="/about/" component={About}/>
<Route exact path="/posts/" component={PostList}/>
<Route path="/posts/:slug" component={Post}/>
<Route path="/users/:user" component={User}/>

4
src/static/about.md Normal file
View file

@ -0,0 +1,4 @@
# Welcome to SudoScientist!
This is Asara, and this is my personal blog.
It will primarily post about technology, personal projects, and other sudo-scientific and sudo-philosophical ramblings.