Skip to content

Commit

Permalink
Merge pull request #64 from daleinen7/tv-sidescroll
Browse files Browse the repository at this point in the history
side scrolling tv list
  • Loading branch information
daleinen7 authored Oct 13, 2021
2 parents b46cb4b + bc21f8e commit a699452
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 42 deletions.
20 changes: 14 additions & 6 deletions src/components/StoriesList/StoriesList.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@
}

.stories_list {
display: flex;
flex-flow: row wrap;
justify-content: center;
max-width: 1200px;
margin: 0 auto;
width: 100%;
ul {
overflow-x: auto;
display: flex;
flex-flow: row;
max-width: 1200px;
margin: 0 auto;
}

li {
width: 390px;
}

a {
display: flex;
Expand All @@ -24,7 +31,8 @@
text-decoration: none;
background: $blue;
border-radius: 36px;
max-width: 350px;
width: 350px;

height: 330px;
margin: 20px;
padding: 20px;
Expand Down
72 changes: 37 additions & 35 deletions src/components/StoriesList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,45 @@ export default function StoriesList({ stories, images }) {
return (
<section className={styles.stories}>
<Arrow color={"white"} />
<ul className={styles.stories_list}>
{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 (
<li key={index}>
<Link to={story.parent.name}>
<div className={styles.screen_and_controls}>
<div className={styles.screenContainer}>
<GatsbyImage
className={styles.gatsby_wrapper}
image={image?.childrenImageSharp[0].gatsbyImageData}
alt={story.title}
/>
<div className={styles.screen}></div>
</div>
<div className={styles.controls}>
<div className={styles.dial}></div>
<div className={styles.dial}></div>
<div className={styles.led_container}>
<div className={styles.led}></div>
<div className={styles.led}></div>
<div className={styles.led}></div>
<div className={styles.stories_list}>
<ul>
{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 (
<li key={index}>
<Link to={story.parent.name}>
<div className={styles.screen_and_controls}>
<div className={styles.screenContainer}>
<GatsbyImage
className={styles.gatsby_wrapper}
image={image?.childrenImageSharp[0].gatsbyImageData}
alt={story.title}
/>
<div className={styles.screen}></div>
</div>
<div className={styles.controls}>
<div className={styles.dial}></div>
<div className={styles.dial}></div>
<div className={styles.led_container}>
<div className={styles.led}></div>
<div className={styles.led}></div>
<div className={styles.led}></div>
</div>
<div className={styles.vent}></div>
<div className={styles.vent}></div>
<div className={styles.vent}></div>
</div>
<div className={styles.vent}></div>
<div className={styles.vent}></div>
<div className={styles.vent}></div>
</div>
</div>
<div className={styles.title}>{story.title}</div>
</Link>
</li>
);
})}
</ul>
<div className={styles.title}>{story.title}</div>
</Link>
</li>
);
})}
</ul>
</div>
</section>
);
}
8 changes: 7 additions & 1 deletion static/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,20 @@ public_folder: /img

collections:
- name: "story"

label: "Story"
extension: "json"
create: true
folder: "static/stories"
editor:
preview: false
fields:
- { label: "Title", name: "title", widget: "string" }
- {
label: "Title",
name: "title",
widget: "string",
pattern: ["^.{0,10}$", "Must have at least 20 characters"],
}
- { label: "Level", name: "level", widget: "number" }
- { label: "Title Card", name: "title-card", widget: "image" }
- label: "Authors"
Expand Down

0 comments on commit a699452

Please sign in to comment.