1
1
import React from 'react' ;
2
- // NOTE: This slows down performance, even during development
3
- // if (process.env.NODE_ENV !== 'production') {
4
- // const { whyDidYouUpdate } = require('why-did-you-update');
5
- // whyDidYouUpdate(React, { exclude: [ /^HotKeysWrapper/ ] } );
6
- // }
2
+
7
3
import TranscriptEditor from '../packages/components/transcript-editor' ;
8
4
import SttTypeSelect from './select-stt-json-type' ;
9
5
import ExportFormatSelect from './select-export-format' ;
10
6
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' ;
11
7
import { faGithub } from '@fortawesome/free-brands-svg-icons' ;
12
8
13
- import demoTranscript from './sample-data/KateDarling-bbcKaldiTranscriptWithSpeakerSegments.json' ;
14
- const demoMediaUrl = 'https://download.ted.com/talks/KateDarling_2018S-950k.mp4' ;
15
- const demoTitle = 'Ted Talk - Kate Darling' ;
9
+ import DEMO_TRANSCRIPT from './sample-data/KateDarling-bbcKaldiTranscriptWithSpeakerSegments.json' ;
10
+ const DEMO_MEDIA_URL = 'https://download.ted.com/talks/KateDarling_2018S-950k.mp4' ;
11
+ const DEMO_TITLE = 'TED Talk | Kate Darling - Why we have an emotional connection to robots ' ;
16
12
17
- import style from './index.module.css ' ;
13
+ import style from './index.module.scss ' ;
18
14
19
15
class App extends React . Component {
20
16
constructor ( props ) {
@@ -36,9 +32,9 @@ class App extends React.Component {
36
32
37
33
loadDemo = ( ) => {
38
34
this . setState ( {
39
- transcriptData : demoTranscript ,
40
- mediaUrl : demoMediaUrl ,
41
- title : demoTitle ,
35
+ transcriptData : DEMO_TRANSCRIPT ,
36
+ mediaUrl : DEMO_MEDIA_URL ,
37
+ title : DEMO_TITLE ,
42
38
sttType : 'bbckaldi'
43
39
} ) ;
44
40
}
@@ -52,7 +48,7 @@ class App extends React.Component {
52
48
if ( canPlay ) {
53
49
const fileURL = URL . createObjectURL ( file ) ;
54
50
this . setState ( {
55
- // transcriptData: demoTranscript ,
51
+ // transcriptData: DEMO_TRANSCRIPT ,
56
52
mediaUrl : fileURL ,
57
53
fileName : file . name
58
54
} ) ;
@@ -65,7 +61,7 @@ class App extends React.Component {
65
61
const fileURL = prompt ( "Paste the URL you'd like to use here:" ) ;
66
62
67
63
this . setState ( {
68
- // transcriptData: demoTranscript ,
64
+ // transcriptData: DEMO_TRANSCRIPT ,
69
65
mediaUrl : fileURL
70
66
} ) ;
71
67
}
@@ -178,19 +174,19 @@ class App extends React.Component {
178
174
</ section >
179
175
180
176
< section className = { style . demoNavItem } >
181
- < label className = { style . sectionLabel } > Custom Media</ label >
182
- < button onClick = { ( ) => this . handleLoadMediaUrl ( ) } > Load from URL</ button >
177
+ < label className = { style . sectionLabel } > Load Media</ label >
178
+ < button onClick = { ( ) => this . handleLoadMediaUrl ( ) } > From URL</ button >
183
179
< input
184
180
type = { 'file' }
185
181
id = { 'mediaFile' }
186
182
onChange = { e => this . handleLoadMedia ( e . target . files ) }
187
183
/>
188
- < label htmlFor = "mediaFile" > Load local media </ label >
184
+ < label htmlFor = "mediaFile" > From Computer </ label >
189
185
{ this . state . fileName !== '' ? < label className = { style . fileNameLabel } > { this . state . fileName } </ label > : null }
190
186
</ section >
191
187
192
188
< section className = { style . demoNavItem } >
193
- < label className = { style . sectionLabel } > Import Transcript</ label >
189
+ < label className = { style . sectionLabel } > Load Transcript</ label >
194
190
< SttTypeSelect
195
191
className = { style . dropdown }
196
192
name = { 'sttType' }
@@ -203,7 +199,7 @@ class App extends React.Component {
203
199
id = { 'transcriptFile' }
204
200
onChange = { e => this . handleLoadTranscriptJson ( e . target . files ) }
205
201
/>
206
- < label htmlFor = "transcriptFile" > Load Transcript </ label >
202
+ < label htmlFor = "transcriptFile" > From Computer </ label >
207
203
{ this . state . transcriptData !== null ? < label className = { style . fileNameLabel } > Transcript loaded.</ label > : null }
208
204
209
205
</ section >
@@ -254,7 +250,11 @@ class App extends React.Component {
254
250
/>
255
251
</ div >
256
252
257
- < button className = { style . warningButton } onClick = { ( ) => this . clearLocalStorage ( ) } > Clear Local Storage</ button >
253
+ < button
254
+ className = { style . warningButton }
255
+ onClick = { ( ) => this . clearLocalStorage ( ) } >
256
+ Clear Local Storage
257
+ </ button >
258
258
</ section >
259
259
</ div >
260
260
@@ -281,6 +281,4 @@ class App extends React.Component {
281
281
}
282
282
}
283
283
284
- // render(<App />, document.getElementById('root'));
285
-
286
284
export default App ;
0 commit comments