From 243ee909f8a3784b6bbe97ed5fdf6a87ce560213 Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Fri, 18 May 2018 17:49:39 +0300 Subject: [PATCH] add links to rss for thread & site --- .../input/__actions/input__actions.scss | 6 ++++++ .../input/__button/input__button.scss | 6 +----- .../input/__buttons/input__buttons.scss | 4 ---- .../input/__rss-link/input__rss-link.scss | 11 +++++++++++ .../components/input/__rss/input__rss.scss | 7 +++++++ web/app/components/input/index.js | 5 ++++- web/app/components/input/input.jsx | 19 +++++++++++++++++-- 7 files changed, 46 insertions(+), 12 deletions(-) create mode 100644 web/app/components/input/__actions/input__actions.scss delete mode 100644 web/app/components/input/__buttons/input__buttons.scss create mode 100644 web/app/components/input/__rss-link/input__rss-link.scss create mode 100644 web/app/components/input/__rss/input__rss.scss diff --git a/web/app/components/input/__actions/input__actions.scss b/web/app/components/input/__actions/input__actions.scss new file mode 100644 index 00000000..49060e33 --- /dev/null +++ b/web/app/components/input/__actions/input__actions.scss @@ -0,0 +1,6 @@ +.input__actions { + display: flex; + align-items: center; + padding-top: 8px; + background: #eee; +} diff --git a/web/app/components/input/__button/input__button.scss b/web/app/components/input/__button/input__button.scss index 5db2fff3..015daa0a 100644 --- a/web/app/components/input/__button/input__button.scss +++ b/web/app/components/input/__button/input__button.scss @@ -1,6 +1,6 @@ .input__button { box-sizing: border-box; - margin: 0; + margin: 0 8px 0 0; padding: 8px 12px; font-size: 16px; border: 0; @@ -10,8 +10,4 @@ &:focus { outline: none; } - - + .input__button { - margin-left: 8px; - } } diff --git a/web/app/components/input/__buttons/input__buttons.scss b/web/app/components/input/__buttons/input__buttons.scss deleted file mode 100644 index 9108d942..00000000 --- a/web/app/components/input/__buttons/input__buttons.scss +++ /dev/null @@ -1,4 +0,0 @@ -.input__buttons { - padding-top: 8px; - background: #eee; -} diff --git a/web/app/components/input/__rss-link/input__rss-link.scss b/web/app/components/input/__rss-link/input__rss-link.scss new file mode 100644 index 00000000..e35e602b --- /dev/null +++ b/web/app/components/input/__rss-link/input__rss-link.scss @@ -0,0 +1,11 @@ +.input__rss-link { + font-weight: 700; + white-space: nowrap; + text-decoration: none; + cursor: pointer; + color: #0aa; + + &:hover { + color: #06c5c5; + } +} diff --git a/web/app/components/input/__rss/input__rss.scss b/web/app/components/input/__rss/input__rss.scss new file mode 100644 index 00000000..c4da29a4 --- /dev/null +++ b/web/app/components/input/__rss/input__rss.scss @@ -0,0 +1,7 @@ +.input__rss { + margin-left: auto; + align-self: flex-end; + font-size: 12px; + line-height: 1; + text-align: right; +} diff --git a/web/app/components/input/index.js b/web/app/components/input/index.js index e530c84b..f4b0cb63 100644 --- a/web/app/components/input/index.js +++ b/web/app/components/input/index.js @@ -4,14 +4,17 @@ export { default } from './input'; require('./input.scss'); +require('./__actions/input__actions.scss'); + require('./__button/input__button.scss'); require('./__button/_type/_preview/input__button_type_preview.scss'); require('./__button/_type/_send/input__button_type_send.scss'); -require('./__buttons/input__buttons.scss'); require('./__counter/input__counter.scss'); require('./__error/input__error.scss'); require('./__field/input__field.scss'); require('./__field-wrapper/input__field-wrapper.scss'); require('./__preview/input__preview.scss'); require('./__preview-wrapper/input__preview-wrapper.scss'); +require('./__rss/input__rss.scss'); +require('./__rss-link/input__rss-link.scss'); diff --git a/web/app/components/input/input.jsx b/web/app/components/input/input.jsx index 2338f04c..28c5370c 100644 --- a/web/app/components/input/input.jsx +++ b/web/app/components/input/input.jsx @@ -1,10 +1,14 @@ import { h, Component } from 'preact'; -import { DEFAULT_MAX_COMMENT_SIZE } from 'common/constants'; +import { BASE_URL, API_BASE, DEFAULT_MAX_COMMENT_SIZE } from 'common/constants'; +import { siteId, url } from 'common/settings'; import api from 'common/api'; import store from 'common/store'; +const RSS_THREAD_URL = `${BASE_URL}${API_BASE}/rss/post?site=${siteId}&url=${url}`; +const RSS_SITE_URL = `${BASE_URL}${API_BASE}/rss/site?site=${siteId}`; + export default class Input extends Component { constructor(props) { super(props); @@ -131,7 +135,7 @@ export default class Input extends Component { isErrorShown &&

Something went wrong. Please try again a bit later.

} -
+
+ +
+ Subscribe to this + {' '} + Thread + {' '} + or  + Site + {' '} + by RSS +
{