Skip to content

Commit

Permalink
part 12
Browse files Browse the repository at this point in the history
  • Loading branch information
rwieruch committed Sep 1, 2017
1 parent 676b982 commit 536823e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/components/Stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const COLUMNS = {
},
};

const Stories = ({ storyStore, archiveStore }) =>
const Stories = ({ storyStore }) =>
<div className="stories">
<StoriesHeader columns={COLUMNS} />

Expand All @@ -34,7 +34,6 @@ const Stories = ({ storyStore, archiveStore }) =>
key={story.objectID}
story={story}
columns={COLUMNS}
onArchive={archiveStore.archiveStory}
/>
)}
</div>
Expand All @@ -51,4 +50,4 @@ const StoriesHeader = ({ columns }) =>
)}
</div>

export default inject('storyStore', 'archiveStore')(observer(Stories));
export default inject('storyStore')(observer(Stories));
7 changes: 4 additions & 3 deletions src/components/Story.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { ButtonInline } from './Button';
import './Story.css';

const Story = ({ story, columns, onArchive }) => {
const Story = ({ story, columns, archiveStore }) => {
const {
title,
url,
Expand All @@ -27,12 +28,12 @@ const Story = ({ story, columns, onArchive }) => {
{points}
</span>
<span style={{ width: columns.archive.width }}>
<ButtonInline onClick={() => onArchive(objectID)}>
<ButtonInline onClick={() => archiveStore.archiveStory(objectID)}>
Archive
</ButtonInline>
</span>
</div>
);
}

export default Story;
export default inject('archiveStore')(observer(Story));

0 comments on commit 536823e

Please sign in to comment.