From 0ed16ffe2975b62546e483da926f08959efeddea Mon Sep 17 00:00:00 2001 From: Ahmed-Ayman Date: Fri, 28 Dec 2018 10:49:56 +0200 Subject: [PATCH] refactor the css to be global for all the random sections --- src/components/RandomDate.js | 66 ++++++++++++++++++++++++++------ src/components/RandomPlace.js | 29 ++++++++------ src/components/RandomTopic.js | 11 +++--- src/stylesheets/random-item.scss | 16 ++++---- src/stylesheets/video-item.scss | 1 - 5 files changed, 86 insertions(+), 37 deletions(-) diff --git a/src/components/RandomDate.js b/src/components/RandomDate.js index dc0ad7b..0266f15 100644 --- a/src/components/RandomDate.js +++ b/src/components/RandomDate.js @@ -1,25 +1,69 @@ +import Grid from 'react-css-grid' import React from 'react'; -import Grid from 'react-css-grid'; +import PropTypes from 'prop-types'; import VideoItem from "./VideoItem"; -import SectionHeading from "./SectionHeading"; +import RandomItemTitle from "./SectionHeading"; +import {Link} from 'react-router-dom'; class RandomDate extends React.Component { - render() { + shuffleDate() { + this.props.getRandomDateVideos(this.props.allDates); + } + + render() { return ( -
- +
+

+ من أماكن الارشيف +
+ + Dates from the archive + + +

- - - - + width={450} + > + {/* View all dates button*/} + + + + {/* Shuffle button */} + + + + {/*{this.props.videos.map(video =>*/} + {/**/} + {/*)}*/} + +
+ ) } } +RandomDate.propTypes = { + dateName: PropTypes.string, + allDates: PropTypes.array, + videos: PropTypes.array, + loading: PropTypes.bool, + dateCount: PropTypes.number, + getRandomDateVideos: PropTypes.func +}; + export default (RandomDate); \ No newline at end of file diff --git a/src/components/RandomPlace.js b/src/components/RandomPlace.js index f041692..a3f097f 100644 --- a/src/components/RandomPlace.js +++ b/src/components/RandomPlace.js @@ -13,26 +13,29 @@ class RandomPlace extends React.Component { render() { return ( -
-

from the Archive Places - من مواضيع الارشيف

- +
+

+ من أماكن الارشيف +
+ + Places from the archive + + +

{/* View all places button*/} - - {/* Shuffle button */} @@ -44,6 +47,10 @@ class RandomPlace extends React.Component { )} +
) diff --git a/src/components/RandomTopic.js b/src/components/RandomTopic.js index 9215774..c1fbf41 100644 --- a/src/components/RandomTopic.js +++ b/src/components/RandomTopic.js @@ -5,6 +5,7 @@ import VideoItem from "./VideoItem"; import RandomItemTitle from "./SectionHeading"; import {Link} from 'react-router-dom'; +// Refactor class RandomTopic extends React.Component { shuffleTopic() { @@ -13,13 +14,13 @@ class RandomTopic extends React.Component { render() { return ( -
+

من مواضيع الارشيف
{/*topics from the Archive */} - topics from the archive + topics from the archive

@@ -29,9 +30,9 @@ class RandomTopic extends React.Component { width={450} > {/* View all topics button*/} - - diff --git a/src/stylesheets/random-item.scss b/src/stylesheets/random-item.scss index 0696d80..4590530 100644 --- a/src/stylesheets/random-item.scss +++ b/src/stylesheets/random-item.scss @@ -5,12 +5,10 @@ .section-subheading { padding-top: 2em; } - +// TODO: Refactor .section-title { - //padding-top: 1em; line-height: 0.5; text-align: center; - //padding: 1em; } // the bottom section @@ -50,20 +48,20 @@ h3.section-title { bottom: -3px; } - +// TODO: Refactor // buttons -.random-topic { +.random-item-container { button { background: white; } - // topics - .view-topics-link { + // view all and shuffle button + .view-items-link { justify-self: left; bottom: 36px; position: relative; padding: 0px; } - .view-all-topics { + .view-all-items { left: 0; //position: absolute; justify-self: left; @@ -81,7 +79,7 @@ h3.section-title { } // fonts -.shuffle-button, .view-all-topics { +.shuffle-button, .view-all-items { span.arabic-text { font-size: 18px; } diff --git a/src/stylesheets/video-item.scss b/src/stylesheets/video-item.scss index e925ad3..acaa9e8 100644 --- a/src/stylesheets/video-item.scss +++ b/src/stylesheets/video-item.scss @@ -7,7 +7,6 @@ background: $light-gray-color; min-height: 300px; padding: 1em; - } .video-thumbnail {