Skip to content

Commit c707748

Browse files
authored
Merge pull request #265 from bbc/analytics-howDoesThisWork
analytics for how does this work hover
2 parents 6ebe48d + 28213bb commit c707748

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/components/transcript-editor/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ class TranscriptEditor extends React.Component {
463463
settings={settings}
464464
shortcuts={shortcuts}
465465
exportOptions={exportOptions}
466-
tooltip={HowDoesThisWork}
466+
tooltip={HowDoesThisWork(this.props.handleAnalyticsEvents)}
467467
mediaUrl={this.props.mediaUrl}
468468
mediaControls={this.videoRef.current ? mediaControls : null}
469469
handleSettingsToggle={this.handleSettingsToggle}

packages/components/transcript-editor/src/HowDoesThisWork.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const helpMessage = (
3737
</div>
3838
);
3939

40-
const HowDoesThisWork = (
40+
const HowDoesThisWork = (handleAnalyticsEvents) => (
4141
<Tooltip
4242
className={ style.help }
4343
content={ helpMessage }
@@ -48,6 +48,15 @@ const HowDoesThisWork = (
4848
border={ '#ffffff' }
4949
background={ '#f2f2f2' }
5050
color={ '#000000' }
51+
onMouseOver={ () => {
52+
if (handleAnalyticsEvents) {
53+
handleAnalyticsEvents({
54+
category: "TranscriptEditor",
55+
action: "hover",
56+
name: "howDoesThisWork"
57+
});
58+
}
59+
} }
5160
>
5261
<FontAwesomeIcon className={ style.icon } icon={ faQuestionCircle } />
5362
How does this work?

0 commit comments

Comments
 (0)