From b782a40f6363ea1f0c336b3f96dd3689b15daf7b Mon Sep 17 00:00:00 2001 From: Steven Than Date: Thu, 18 Apr 2019 02:45:45 -0400 Subject: [PATCH 1/3] updated styles --- src/styles/StoriesIndex.css | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/styles/StoriesIndex.css b/src/styles/StoriesIndex.css index b804489..e3f8e12 100644 --- a/src/styles/StoriesIndex.css +++ b/src/styles/StoriesIndex.css @@ -1,26 +1,3 @@ .stories-page.container { - padding-top: 80px; - margin-left: 0px; - margin-right: 0px; - max-width: 100%; -} - -.create-story { - float: right; -} -.create-story.btn.btn-primary { - color: rgba(13, 22, 38, 0.8) !important; -} -.trending-card { - background-color: rgb(191, 217, 213) !important; -} - -.trending-label { - font-size: 20px; - font-weight: 600; - margin-top: 3px; -} - -.trending-stories-overflow { - overflow-x: scroll; + padding-top: 75px; } From 91229bdbde074e614f0096d6f0f574e48a7b1e40 Mon Sep 17 00:00:00 2001 From: Steven Than Date: Thu, 18 Apr 2019 02:46:21 -0400 Subject: [PATCH 2/3] refactored Stories related components --- src/components/Stories/TrendingStories.js | 140 ++++++------ src/components/Stories/TrendingStoryDetail.js | 201 +++++++----------- src/components/Stories/index.js | 41 ++-- 3 files changed, 155 insertions(+), 227 deletions(-) diff --git a/src/components/Stories/TrendingStories.js b/src/components/Stories/TrendingStories.js index 8166831..83b7924 100644 --- a/src/components/Stories/TrendingStories.js +++ b/src/components/Stories/TrendingStories.js @@ -56,7 +56,6 @@ class TrendingStories extends Component { approvedStories: response.data.data, approvedStoriesLength: response.data.data.length, color: color, - userSelectedStory: 'none', loading: false }); }) @@ -186,7 +185,6 @@ class TrendingStories extends Component { approvedStories: response.data.data, approvedStoriesLength: response.data.data.length, color: color, - userSelectedStory: 'none', loading: false }); }) @@ -217,7 +215,6 @@ class TrendingStories extends Component { approvedStories: response.data.data, approvedStoriesLength: response.data.data.length, color: color, - userSelectedStory: 'none', loading: false }); }) @@ -231,82 +228,85 @@ class TrendingStories extends Component { //Displaying spinner untill API fetches the data if (this.props.TrendingStoriesReducer.loading) { return ( -
- +
+
); } //Dislaying list of stories + search box else { return ( -
-
- - {'Sort By: '} - - - + + +

Trending stories

+ + + {'Sort By: '} + + + - - - - - + + + +
+ - - {/* this is a working button in case we want a search button. I removed the css though - but i can add it back pretty quickly if we wanted it. - -
-
*/} -
- {this.getStoryDetails()} -
-
-
- -
-
+ {/* this is a working button in case we want a search button. I removed the css though + but i can add it back pretty quickly if we wanted it. + +
+
*/} +
+ {this.getStoryDetails()} +
+
+
+ +
+ + ); } } diff --git a/src/components/Stories/TrendingStoryDetail.js b/src/components/Stories/TrendingStoryDetail.js index 9167bcc..207ee14 100644 --- a/src/components/Stories/TrendingStoryDetail.js +++ b/src/components/Stories/TrendingStoryDetail.js @@ -1,14 +1,5 @@ import React, { Component } from 'react'; -import { - Media, - Row, - Badge, - Alert, - Card, - Col, - CardHeader, - Button -} from 'reactstrap'; +import { Row, Badge, Col, Button } from 'reactstrap'; import '../../styles/ViewStories.css'; import { connect } from 'react-redux'; import _ from 'lodash'; @@ -128,127 +119,77 @@ class TrendingStoryDetail extends Component { } render() { - if (this.props.TrendingStoriesReducer.userSelectedStory === 'none') { - return ( -
- - Please select a story to view its details! - -
- ); - } else { - return ( - - {window.innerWidth <= mobileStyle && ( - + if (!this.props.TrendingStoriesReducer.userSelectedStory) return null; + return ( + + +