-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: adding size properties to children
- Loading branch information
Eimi Okuno
authored and
Eimi Okuno
committed
Oct 18, 2019
1 parent
618b7ba
commit 9c6c414
Showing
3 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React, { Component } from 'react'; | ||
import Col from 'react-bootstrap/Col'; | ||
import Row from 'react-bootstrap/Row'; | ||
import Card from 'react-bootstrap/Card'; | ||
import Container from 'react-bootstrap/Container'; | ||
import Button from 'react-bootstrap/Button'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { | ||
faSync, | ||
} from '@fortawesome/free-solid-svg-icons'; | ||
import ProgrammeScriptContainer from '../ProgrammeScriptContainer'; | ||
import PreviewCanvas from '../PreviewCanvas'; | ||
|
||
class ProgramScript extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
resetPreview: false, | ||
playlist: props.playlist | ||
}; | ||
} | ||
|
||
// information around progressbar in the playlist object | ||
render() { | ||
return ( | ||
<> | ||
<Container> | ||
<Row> | ||
|
||
<Col> | ||
</Col> | ||
<Col> | ||
<h2 | ||
className={ [ 'text-truncate', 'text-muted' ].join(' ') } | ||
title={ `Programme Script Title: ${ this.state.programmeScript ? this.state.programmeScript.title : '' }` }> | ||
{this.state.programmeScript ? this.state.programmeScript.title : ''} | ||
</h2> | ||
<Card> | ||
<Card.Header> | ||
{ !this.state.resetPreview ? | ||
<PreviewCanvas width="100%" height="100%" playlist={ this.state.playlist } /> | ||
: null } | ||
</Card.Header> | ||
|
||
<Card.Header> | ||
<Row noGutters> | ||
<Col sm={ 12 } md={ 3 } > | ||
<Button variant="outline-secondary" | ||
onClick={ this.handleUpdatePreview } | ||
title="update preview" | ||
> | ||
<FontAwesomeIcon icon={ faSync } /> Preview | ||
</Button> | ||
</Col> | ||
</Row> | ||
</Card.Header> | ||
|
||
<Card.Body> | ||
<article | ||
style={ { height: '60vh', overflow: 'scroll' } } | ||
> | ||
<ProgrammeScriptContainer | ||
items={ this.props.items } | ||
handleReorder={ this.props.handleReorder } | ||
handleDelete={ this.props.handleDelete } | ||
handleEdit={ this.props.handleEdit } | ||
/> | ||
|
||
</article> | ||
</Card.Body> | ||
</Card> | ||
</Col> | ||
</Row> | ||
</Container> | ||
</> | ||
); | ||
} | ||
} | ||
|
||
export default ProgramScript; |
59 changes: 59 additions & 0 deletions
59
packages/components/ProgrammeScriptEditor/stories/index.stories.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react'; | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import ProgrammeScriptEditor from '../index.js'; | ||
import PreviewCanvas from '../../PreviewCanvas'; | ||
|
||
export const handleReorderActions = action('Handle reorder'); | ||
export const handleDeleteActions = action('Handle delete'); | ||
export const handleEditActions = action('Handle edit'); | ||
|
||
const items = [ | ||
{ | ||
type: 'title', | ||
text: 'An immense Achievement' | ||
}, | ||
{ | ||
type: 'paper-cut', | ||
id: 1, | ||
speaker: 'Mr Loud', | ||
words: [ { text:'Greatest day of my life was when I wrote this text.', start: 0, end: 1 } ] | ||
}, | ||
{ | ||
type: 'note', | ||
text: 'Maybe a little bit obnoxious' | ||
}, | ||
{ | ||
type: 'insert', | ||
text: 'Insert New Selection here' | ||
}, | ||
{ | ||
type: 'paper-cut', | ||
id: 2, | ||
speaker: 'Mrs Loud', | ||
words: [ { text:'Greatest day of my life was when I spoke this text.', start: 0, end: 1 } ] | ||
}, | ||
{ | ||
type: 'voice-over', | ||
text: 'link: wonderful times of the Loud family' | ||
}, | ||
]; | ||
|
||
const playlist = [ | ||
{ type:'video', start:0, sourceStart: 30, duration:10, src:'https://download.ted.com/talks/MorganVague_2018X.mp4' }, | ||
{ type:'video', start:10, sourceStart: 40, duration:10, src:'https://download.ted.com/talks/IvanPoupyrev_2019.mp4' }, | ||
{ type:'video', start:20, sourceStart: 50, duration:10, src:'https://download.ted.com/talks/KateDarling_2018S-950k.mp4' }, | ||
|
||
]; | ||
|
||
storiesOf('ProgrammeScriptEditor (not published)', module) | ||
.add('Default', () => | ||
<ProgrammeScriptEditor | ||
playlist={ playlist } | ||
items={ items } | ||
handleDelete={ handleDeleteActions } | ||
handleEdit={ handleEditActions } | ||
handleReorder={ handleReorderActions } | ||
/> | ||
); |