From 3b381577f839863eed5aea2c3bb76eaae8706f67 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 18 Jun 2018 22:45:39 +0300 Subject: tag feed --- vnext/src/components/Feeds.js | 7 ++++++- vnext/src/index.js | 23 +++++++++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/vnext/src/components/Feeds.js b/vnext/src/components/Feeds.js index cf593b5e..b8367de4 100644 --- a/vnext/src/components/Feeds.js +++ b/vnext/src/components/Feeds.js @@ -18,6 +18,11 @@ export function Blog(props) { return () } +export function Tag(props) { + const { tag } = props.match.params; + return () +} + class Feed extends React.Component { constructor(props) { super(props); @@ -75,6 +80,6 @@ Feed.propTypes = { msgs: PropTypes.array, query: PropTypes.shape({ baseUrl: PropTypes.string.isRequired, - search: PropTypes.array + search: PropTypes.object }) }; diff --git a/vnext/src/index.js b/vnext/src/index.js index 4142f2c4..24421545 100644 --- a/vnext/src/index.js +++ b/vnext/src/index.js @@ -1,8 +1,8 @@ import React from 'react'; import ReactDOM from 'react-dom'; -import { BrowserRouter as Router, Route, Link } from 'react-router-dom'; +import { BrowserRouter as Router, Route, Link, Switch } from 'react-router-dom'; import Icon from './components/Icon'; -import { Discover, Discussions, Blog } from './components/Feeds'; +import { Discover, Discussions, Blog, Tag } from './components/Feeds'; import Post from './components/Post'; import Thread from './components/Thread'; import LoginButton from './components/LoginButton'; @@ -25,7 +25,7 @@ class App extends React.Component { this.wScrollCurrent = 0; this.wScrollBefore = 0; this.wScrollDiff = 0; - + window.addEventListener('scroll', this.throttle(500, () => { this.dHeight = document.body.offsetHeight; this.wHeight = window.innerHeight; @@ -37,14 +37,14 @@ class App extends React.Component { this.setState({ headerClassName: '' }) - } else if (this.wScrollDiff > 0 && this.state.headerClassName.indexOf(elClassHidden) >=0) { + } else if (this.wScrollDiff > 0 && this.state.headerClassName.indexOf(elClassHidden) >= 0) { // scrolled up; element slides in this.setState({ headerClassName: elClassBackground }) } else if (this.wScrollDiff < 0) { // scrolled down - if (this.wScrollCurrent + this.wHeight >= this.dHeight && this.state.headerClassName.indexOf(elClassHidden) >=0) { + if (this.wScrollCurrent + this.wHeight >= this.dHeight && this.state.headerClassName.indexOf(elClassHidden) >= 0) { // scrolled to the very bottom; element slides in this.setState({ headerClassName: elClassBackground @@ -118,11 +118,14 @@ class App extends React.Component {
- } /> - } /> - } /> - } /> - } /> + + } /> + } /> + } /> + } /> + } /> + } /> +
-- cgit v1.2.3