Skip to content

Commit

Permalink
refactor(ReadMe): remove history/commit data from Readme
Browse files Browse the repository at this point in the history
Let's create a lightweight component that is only used when we are looking at a versioned readme, so we can remove references to history and commits in the `ReadMe` component
  • Loading branch information
ramfox committed Nov 12, 2019
1 parent c28d49b commit ae8c39f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion app/components/ReadMe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const DEBOUNCE_TIMER = 1000

export interface ReadmeProps {
peername: string
path: string
name: string
value: string
preview: string
Expand Down
9 changes: 3 additions & 6 deletions app/containers/ReadmeContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,14 @@ import Store from '../models/store'
import { fsiWriteAndFetch, fetchReadmePreview } from '../actions/api'

const mapStateToProps = (state: Store) => {
const { workingDataset, commitDetails, selections } = state
const history = selections.activeTab === 'history'
const dataset = history ? commitDetails : workingDataset
const { value } = dataset.components.readme
const { workingDataset, selections } = state
const { value } = workingDataset.components.readme

const { peername, name, commit } = selections
const { peername, name } = selections

// get data for the currently selected component
return {
peername,
path: commit,
name,
value,
history,
Expand Down

0 comments on commit ae8c39f

Please sign in to comment.