From f237fc224171084501d84d69ba2ecf2f586307a4 Mon Sep 17 00:00:00 2001 From: daleinen7 Date: Mon, 11 Oct 2021 22:42:52 -0500 Subject: [PATCH] side scrolling tv list --- .../StoriesList/StoriesList.module.scss | 23 ++++-- src/components/StoriesList/index.jsx | 72 ++++++++++--------- 2 files changed, 54 insertions(+), 41 deletions(-) diff --git a/src/components/StoriesList/StoriesList.module.scss b/src/components/StoriesList/StoriesList.module.scss index 7debf19..9fb5302 100644 --- a/src/components/StoriesList/StoriesList.module.scss +++ b/src/components/StoriesList/StoriesList.module.scss @@ -10,11 +10,21 @@ } .stories_list { - display: flex; - flex-flow: row wrap; - justify-content: center; - max-width: 1200px; - margin: 0 auto; + overflow-x: auto; + width: 100%; + ul { + overflow-x: auto; + width: 100%; + display: flex; + flex-flow: row; + justify-content: center; + max-width: 1200px; + margin: 0 auto; + } + + li { + width: 390px; + } a { display: flex; @@ -24,7 +34,8 @@ text-decoration: none; background: $blue; border-radius: 36px; - max-width: 350px; + width: 350px; + height: 330px; margin: 20px; padding: 20px; diff --git a/src/components/StoriesList/index.jsx b/src/components/StoriesList/index.jsx index 337a3db..42d82be 100644 --- a/src/components/StoriesList/index.jsx +++ b/src/components/StoriesList/index.jsx @@ -8,43 +8,45 @@ export default function StoriesList({ stories, images }) { return (
-
    - {stories.map((story, index) => { - // find element in the images array that has the first image of the story being mapped over - const image = images.find((ele) => { - return ele.relativePath === story.title_card?.slice(5); - }); - return ( -
  • - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    +
    +
      + {stories.map((story, index) => { + // find element in the images array that has the first image of the story being mapped over + const image = images.find((ele) => { + return ele.relativePath === story.title_card?.slice(5); + }); + return ( +
    • + +
      +
      + +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      +
      -
      -
      -
      -
    -
    {story.title}
    - -
  • - ); - })} -
+
{story.title}
+ + + ); + })} + +
); }