About me
++ Wowzers, this is an about page! +
+diff --git a/public/index.html b/public/index.html index ee16dac..e6f5d3f 100644 --- a/public/index.html +++ b/public/index.html @@ -22,9 +22,9 @@ - - - + + +
blocks
hljs.initHighlightingOnLoad();
}
}
+// Dummy About page just for playing around with ReactRouter
+class About extends Component {
+ render () {
+ return (
+
+
+ About me
+
+
+
+ Wowzers, this is an about page!
+
+
+
+ )
+ }
+}
+
+class FourOhFour extends Component {
+ render () {
+ return (
+
+
+ 404 Oh No!
+
+
+
+ You're lost, bud. Why not try going back Home?
+
+
+
+ )
+ }
+}
+
export default App;
diff --git a/src/Article.js b/src/Article.js
index b49b83c..c3515f6 100644
--- a/src/Article.js
+++ b/src/Article.js
@@ -63,4 +63,29 @@ class Article extends Component {
}
}
-export { Article };
+
+const RoutedArticle = ({match}) => (
+
+)
+
+
+const Articles = ({match}) => (
+ // TODO: This is the thing that'll fetch the articles from the JSON blob
+ // based on the URL that's hit. This will return one or more Articles
+
+
+
+
+ This is page number: {match.params.page}
+
+
+)
+
+export { Article, Articles, RoutedArticle };
diff --git a/src/Header.js b/src/Header.js
index 4d60673..3c58311 100644
--- a/src/Header.js
+++ b/src/Header.js
@@ -1,13 +1,14 @@
import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
class Header extends Component {
render() {
return (
-
+
nickpegg.com
-
+
);
diff --git a/src/Nav.js b/src/Nav.js
index 4c49f01..84f3309 100644
--- a/src/Nav.js
+++ b/src/Nav.js
@@ -1,4 +1,5 @@
import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
import Icon from 'react-fontawesome';
@@ -18,14 +19,29 @@ class ListLink extends Component {
}
}
+class RouterListLink extends Component {
+ render () {
+ let icon = null;
+ if (this.props.icon) {
+ icon =
+ }
+
+ return (
+ { icon } { this.props.name }
+ );
+ }
+}
+
class NavList extends Component {
render() {
+ // TODO: populate these dynamically based on root page names
+ // but keep Home first and RSS at the end
return (
-
-
-
+
+
+
@@ -57,12 +73,18 @@ class TagNav extends Component {
class HistoryNav extends Component {
render() {
+ let left = "";
+ if (!this.props.newest) {
+ left = (
+
+
+ newer posts
+
+ )
+ }
return (
-
-
- newer posts
-
+ { left }
older posts
@@ -72,4 +94,8 @@ class HistoryNav extends Component {
}
}
-export { ListLink, NavList, TagNav, HistoryNav };
+const HistoryNavStart = ({match}) => (
+
+)
+
+export { ListLink, NavList, TagNav, HistoryNav, HistoryNavStart };