2017-03-06 20:58:36 +00:00
|
|
|
import React, { PropTypes } from 'react';
|
2016-08-15 16:12:25 +00:00
|
|
|
|
|
|
|
class TextOutput extends React.Component {
|
|
|
|
componentDidMount() {
|
2017-02-22 19:29:35 +00:00
|
|
|
this.canvasTextOutput.focus();
|
2016-08-15 16:12:25 +00:00
|
|
|
}
|
2017-03-06 20:58:36 +00:00
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
// if the user explicitly clicks on the play button, want to refocus on the text output
|
|
|
|
if (this.props.isPlaying && this.props.previewIsRefreshing) {
|
|
|
|
this.canvasTextOutput.focus();
|
|
|
|
}
|
|
|
|
}
|
2016-08-15 16:12:25 +00:00
|
|
|
render() {
|
|
|
|
return (
|
2016-08-15 22:06:09 +00:00
|
|
|
<section
|
2016-08-16 00:28:18 +00:00
|
|
|
className="text-output"
|
2016-08-15 22:06:09 +00:00
|
|
|
id="canvas-sub"
|
2017-02-22 19:29:35 +00:00
|
|
|
ref={(element) => { this.canvasTextOutput = element; }}
|
2016-08-15 22:06:09 +00:00
|
|
|
tabIndex="0"
|
|
|
|
aria-label="text-output"
|
|
|
|
title="canvas text output"
|
|
|
|
>
|
2016-09-01 03:07:43 +00:00
|
|
|
<h2> Output </h2>
|
2016-08-15 16:12:25 +00:00
|
|
|
<section id="textOutput-content">
|
|
|
|
</section>
|
2016-08-15 22:06:09 +00:00
|
|
|
<p
|
|
|
|
tabIndex="0"
|
2016-08-24 17:10:06 +00:00
|
|
|
role="main"
|
2016-08-15 22:06:09 +00:00
|
|
|
id="textOutput-content-summary"
|
|
|
|
aria-label="text output summary"
|
|
|
|
>
|
|
|
|
</p>
|
2016-08-16 01:09:47 +00:00
|
|
|
<table
|
2016-08-15 22:06:09 +00:00
|
|
|
tabIndex="0"
|
2016-08-24 17:10:06 +00:00
|
|
|
role="main"
|
2016-11-12 16:53:02 +00:00
|
|
|
id="textOutput-content-table"
|
2016-09-01 03:07:43 +00:00
|
|
|
aria-label="text output details"
|
2016-08-15 22:06:09 +00:00
|
|
|
>
|
2016-08-15 16:12:25 +00:00
|
|
|
</table>
|
2016-11-12 16:53:02 +00:00
|
|
|
<div
|
|
|
|
tabIndex="0"
|
|
|
|
role="main"
|
|
|
|
id="textOutput-content-details"
|
|
|
|
aria-label="text output details"
|
|
|
|
>
|
|
|
|
</div>
|
2016-08-15 22:06:09 +00:00
|
|
|
</section>
|
2016-08-15 16:12:25 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-03-06 20:58:36 +00:00
|
|
|
TextOutput.propTypes = {
|
|
|
|
isPlaying: PropTypes.bool.isRequired,
|
|
|
|
previewIsRefreshing: PropTypes.bool.isRequired
|
|
|
|
};
|
|
|
|
|
2016-08-15 16:12:25 +00:00
|
|
|
export default TextOutput;
|