From e03bddcb6b00f8fdd6e735c77f5b52f7897876cd Mon Sep 17 00:00:00 2001 From: Chung Leong Date: Wed, 16 Jan 2019 04:47:06 +0100 Subject: [PATCH] Minor adjustments. --- src/front-end.jsx | 3 ++- src/routing.js | 1 + src/style.scss | 22 ++++++++++++++++++---- src/widgets/html.jsx | 13 ++++++++++++- 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/front-end.jsx b/src/front-end.jsx index 0cedfab..516dddd 100644 --- a/src/front-end.jsx +++ b/src/front-end.jsx @@ -39,12 +39,13 @@ class FrontEnd extends PureComponent { if (sideNavCollapsed) { classNames.push('side-collapsed'); } + let key = route.url; return (
- +
); diff --git a/src/routing.js b/src/routing.js index f2949ed..83cd970 100644 --- a/src/routing.js +++ b/src/routing.js @@ -6,6 +6,7 @@ class Route { this.name = routeManager.name; this.params = routeManager.params; this.history = routeManager.history; + this.url = routeManager.url; } change(url, options) { diff --git a/src/style.scss b/src/style.scss index 78a4131..336a540 100644 --- a/src/style.scss +++ b/src/style.scss @@ -31,11 +31,16 @@ A { overflow: hidden; color: #cccccc; - A:link, A:visited { - color: #cccccc; + A { + opacity: 0.5; - &:hover { - color: #eeccdd; + &:link, &:visited { + opacity: 1; + color: #cccccc; + + &:hover { + color: #eeccdd; + } } } @@ -130,6 +135,7 @@ A { } .button { + flex: 0 0 auto; padding-left: 0.5em; padding-right: 0.5em; border-right: 1px solid transparentize(#cccccc, 0.75); @@ -207,12 +213,20 @@ A { .meta { float: right; text-align: right; + margin-left: 1em; + margin-top: 0.4em; .author { margin-top: 0.25em; } } + .post-list-view { + .excerpt { + margin-top: -0.7em; + } + } + .comments { font-size: 0.9em; padding-left: 1.5em; diff --git a/src/widgets/html.jsx b/src/widgets/html.jsx index 5a628ca..4d51042 100644 --- a/src/widgets/html.jsx +++ b/src/widgets/html.jsx @@ -4,7 +4,11 @@ import ReactHtmlParser from 'react-html-parser'; class HTML extends PureComponent { render() { let { text } = this.props; - return ReactHtmlParser(text); + let options = {}; + if (transformFunc) { + options.transform = transformFunc; + } + return ReactHtmlParser(text, options); } } @@ -15,7 +19,14 @@ if (process.env.NODE_ENV !== 'production') { }; } +let transformFunc = null; + +function setTransformFunction(f) { + transformFunc = f; +} + export { HTML as default, HTML, + setTransformFunction, };