Skip to content

Commit

Permalink
feat(story-list): add images and description
Browse files Browse the repository at this point in the history
  • Loading branch information
KatvonRivia committed Oct 21, 2019
1 parent 5c81f95 commit f5e1f74
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
11 changes: 11 additions & 0 deletions src/scripts/components/story-item/story-item.styl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
padding: 5px

.image
width: 100%
height: 150px
background-color: #ccc
object-fit: cover

.title
margin: 0
margin-top: 5px
font-size: 1.2em

.description
font-size: 1em

a
color: #000
text-decoration: none
3 changes: 2 additions & 1 deletion src/scripts/components/story-item/story-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ interface Props {
const StoryItem: FunctionComponent<Props> = ({story}) => (
<Link to={`/stories/${story.id}`}>
<div className={styles.storyItem}>
<div className={styles.image}></div>
<img src={story.image} className={styles.image} />
<p className={styles.title}>{story.title}</p>
<p className={styles.description}>{story.description}</p>
</div>
</Link>
);
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/components/story-list/story-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const StoryList: FunctionComponent = () => {

useEffect(() => {
dispatch(fetchStories());
}, []);
}, [dispatch]);

return (
<div className={styles.storyList}>
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/components/story/story.styl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
pointer-events: none

.sidepanel
width: 25%
width: 30%
background-color: #fff
pointer-events: auto

Expand Down
1 change: 1 addition & 0 deletions src/scripts/types/story.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface Story {
id: string;
title: string;
description: string;
link: string;
image: string;
}

0 comments on commit f5e1f74

Please sign in to comment.