From 7c45f5ff9056ce5864037d5a891361d2310a737d Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 21 Aug 2018 11:33:33 +0500 Subject: Separate filters component --- src/components/filters/index.js | 24 ++++++++++++++++++++++++ src/components/filters/styles.css | 32 ++++++++++++++++++++++++++++++++ src/containers/feed/index.js | 16 ++-------------- src/containers/feed/styles.css | 37 ++----------------------------------- 4 files changed, 60 insertions(+), 49 deletions(-) create mode 100644 src/components/filters/index.js create mode 100644 src/components/filters/styles.css (limited to 'src') diff --git a/src/components/filters/index.js b/src/components/filters/index.js new file mode 100644 index 0000000..aa5860b --- /dev/null +++ b/src/components/filters/index.js @@ -0,0 +1,24 @@ +import React from 'react'; + +import './styles.css'; + +const Filters = (props) => ( +
+ + + All Languages + +
+ + + List + + + + Grid + +
+
+); + +export default Filters; diff --git a/src/components/filters/styles.css b/src/components/filters/styles.css new file mode 100644 index 0000000..810b7f3 --- /dev/null +++ b/src/components/filters/styles.css @@ -0,0 +1,32 @@ +.btn.view-type, .btn.language-filter { + display: inline; + box-shadow: 0 9px 62px -13px rgba(0, 0, 0, 0.20); +} + +.filters-wrap .view-type.btn { + border-radius: 8px; + padding: 10px 20px; + background: white; + margin-left: 10px; + cursor: default; +} + +.language-filter { + border-radius: 8px; + padding: 10px 20px; + background-color: white; +} + +.view-type a { + color: #ccc; + margin-left: 20px; + text-decoration: none; +} + +.view-type a.active, .view-type a:hover { + color: #343a40; +} + +.view-type a:first-child { + margin-left: 0; +} diff --git a/src/containers/feed/index.js b/src/containers/feed/index.js index 8af92f5..d2e6964 100644 --- a/src/containers/feed/index.js +++ b/src/containers/feed/index.js @@ -2,6 +2,7 @@ import React from 'react'; import './styles.css'; import TopNav from '../../components/top-nav'; +import Filters from '../../components/filters'; class FeedContainer extends React.Component { render() { @@ -15,20 +16,7 @@ class FeedContainer extends React.Component {

Today July 12, 2019

- - - All Languages - -
- - - List - - - - Grid - -
+
diff --git a/src/containers/feed/styles.css b/src/containers/feed/styles.css index 6e006fb..e936cc6 100644 --- a/src/containers/feed/styles.css +++ b/src/containers/feed/styles.css @@ -4,45 +4,12 @@ float: left; } -.group-filters { - float: right; -} - .group-heading .small { font-size: 14px; font-weight: 400; margin-left: 3px; } -.btn.view-type, .btn.language-filter { - display: inline; - box-shadow: 0 9px 62px -13px rgba(0, 0, 0, 0.20); -} - -.language-filter { - border-radius: 8px; - padding: 10px 20px; - background-color: white; -} - -.group-filters .view-type.btn { - border-radius: 8px; - padding: 10px 20px; - background: white; - margin-left: 10px; - cursor: default; -} - -.view-type a { - color: #ccc; - margin-left: 20px; - text-decoration: none; -} - -.view-type a.active, .view-type a:hover { - color: #343a40; -} - -.view-type a:first-child { - margin-left: 0; +.group-filters { + float: right; } -- cgit v1.3