Skip to content

Commit 894ca1d

Browse files
authored
Merge pull request #65 from bbc/help-box
Help box
2 parents 179d106 + 2c5ec22 commit 894ca1d

File tree

6 files changed

+126
-16
lines changed

6 files changed

+126
-16
lines changed

package-lock.json

Lines changed: 76 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
"prop-types": "^15.6.2",
8383
"react": "^16.6.0",
8484
"react-dom": "^16.6.0",
85-
"react-keyboard-shortcuts": "^1.1.3"
85+
"react-keyboard-shortcuts": "^1.1.3",
86+
"react-simple-tooltip": "^2.3.3"
8687
}
8788
}

src/lib/TranscriptEditor/Settings/TimecodeOffset/index.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
.button {
1717
font-weight: lighter;
1818
font-size: 0.8em;
19+
cursor: pointer;
1920
}

src/lib/TranscriptEditor/TimedTextEditor/index.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import Tooltip from 'react-simple-tooltip';
4+
5+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
6+
import { faQuestionCircle, faMousePointer, faICursor, faUserEdit, faKeyboard, faSave } from '@fortawesome/free-solid-svg-icons';
37

48
import {
59
Editor,
@@ -423,6 +427,14 @@ class TimedTextEditor extends React.Component {
423427
}
424428

425429
render() {
430+
const helpMessage = <div className={ style.helpMessage }>
431+
<span><FontAwesomeIcon className={ style.icon } icon={ faMousePointer } />Double click on a word or timestamp to jump to that point in the video.</span>
432+
<span><FontAwesomeIcon className={ style.icon } icon={ faICursor } />Start typing to edit text.</span>
433+
<span><FontAwesomeIcon className={ style.icon } icon={ faUserEdit } />You can add and change names of speakers in your transcript.</span>
434+
<span><FontAwesomeIcon className={ style.icon } icon={ faKeyboard } />Use keyboard shortcuts for quick control.</span>
435+
<span><FontAwesomeIcon className={ style.icon } icon={ faSave } />Save & export to get a copy to your desktop.</span>
436+
</div>;
437+
426438
const currentWord = this.getCurrentWord();
427439
const highlightColour = '#69e3c2';
428440
const unplayedColor = '#767676';
@@ -457,6 +469,17 @@ class TimedTextEditor extends React.Component {
457469

458470
return (
459471
<section>
472+
<Tooltip
473+
className={ style.help }
474+
content={ helpMessage }
475+
fadeDuration={ 250 }
476+
fadeEasing={ 'ease-in' }
477+
placement={ 'bottom' }
478+
radius={ 5 }>
479+
<FontAwesomeIcon className={ style.icon } icon={ faQuestionCircle } />
480+
How does this work?
481+
</Tooltip>
482+
460483
{ this.props.transcriptData !== null ? editor : null }
461484
</section>
462485
);

src/lib/TranscriptEditor/TimedTextEditor/index.module.css

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
@value color-subt-green, color-darkest-grey, color-labs-red from '../colours.module.css';
2+
13
.DraftEditor-root {
24
background: #f9f9f9;
35
}
46

57
/*
68
Giving the editor a oveflow
79
https://github.com/facebook/draft-js/issues/528
8-
*/
10+
*/
911
.editor :global(.public-DraftEditor-content) {
1012
max-height: 75vh;
1113
overflow: auto;
@@ -21,3 +23,23 @@ https://github.com/facebook/draft-js/issues/528
2123
margin: 0 auto;
2224
}
2325
}
26+
27+
.help {
28+
cursor: pointer;
29+
float: right;
30+
padding-right: 0.5em;
31+
padding-left: 11em;
32+
margin: 0.5em 0;
33+
}
34+
35+
.icon {
36+
color: color-labs-red;
37+
margin-right: 0.5em;
38+
}
39+
40+
.helpMessage span {
41+
display: block;
42+
font-size: 0.8em;
43+
font-weight: lighter;
44+
margin-top: 1em;
45+
}

src/lib/TranscriptEditor/index.module.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@value color-subt-green, color-darkest-grey from './colours.module.css';
1+
@value color-subt-green, color-darkest-grey, color-labs-red from './colours.module.css';
22

33
/* Desktop size */
44
@media (min-width: 768px) {
@@ -47,10 +47,6 @@
4747
width: 2em;
4848
height: 2em;
4949
}
50-
51-
.cog {
52-
font-weight: lighter;
53-
}
5450
}
5551

5652
/* Mobile devices */

0 commit comments

Comments
 (0)