just-paja/radio-drama-queen

View on GitHub
src/soundWorkspaces/components/StoryView.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react'

import { Center } from '../../components'
import { StoryList, StoryRenameDialog } from '../../soundStories/components'
import { StoryShortcuts } from './StoryShortcuts'

export class StoryView extends React.PureComponent {
  constructor (props) {
    super(props)
    this.handleStoryFocus = this.handleStoryFocus.bind(this)
  }

  state = {
    focusedStory: null
  }

  handleStoryFocus (focusedStory) {
    this.setState({ focusedStory })
  }

  render () {
    const { focusedStory } = this.state
    return (
      <Center>
        <StoryList focusedStory={focusedStory} />
        <StoryRenameDialog />
        <StoryShortcuts
          focusedStory={focusedStory}
          onFocus={this.handleStoryFocus}
        />
      </Center>
    )
  }
}