Last change
on this file since 1303 was
964,
checked in by Maciej Komosinski, 4 years ago
|
Improved layout, added one free-text question, properly counted the number of Parts in the Model instead of counting 'X' in the genotype
|
File size:
1.8 KB
|
Line | |
---|
1 | /*global Module*/ |
---|
2 | "use strict"; |
---|
3 | import React from 'react'; |
---|
4 | |
---|
5 | const styles = { |
---|
6 | content: { |
---|
7 | position: 'absolute', |
---|
8 | height: '100%', |
---|
9 | width: '100%', |
---|
10 | top: '50%', |
---|
11 | textAlign: 'center', |
---|
12 | fontSize: '30px' |
---|
13 | }, |
---|
14 | text: { |
---|
15 | fontFamily: "'Fira Mono', Monaco, 'Andale Mono', 'Lucida Console', 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace" |
---|
16 | } |
---|
17 | } |
---|
18 | |
---|
19 | /** |
---|
20 | * Component for assesing genotypes matching. |
---|
21 | */ |
---|
22 | class EndViewer extends React.Component { |
---|
23 | /** |
---|
24 | * Basic constructor. |
---|
25 | * @param {any} props properties of Component |
---|
26 | */ |
---|
27 | constructor(props) { |
---|
28 | super(props); |
---|
29 | this.props = props; |
---|
30 | |
---|
31 | this.download = this.download.bind(this); |
---|
32 | } |
---|
33 | |
---|
34 | download(type) { |
---|
35 | let file = new Blob([this.props.result], {type: type}); |
---|
36 | let filename = this.props.userId + '.csv'; |
---|
37 | if (window.navigator.msSaveOrOpenBlob) // IE10+ |
---|
38 | window.navigator.msSaveOrOpenBlob(file, filename); |
---|
39 | else { // Others |
---|
40 | let a = document.createElement("a"), |
---|
41 | url = URL.createObjectURL(file); |
---|
42 | a.href = url; |
---|
43 | a.download = filename; |
---|
44 | document.body.appendChild(a); |
---|
45 | a.click(); |
---|
46 | setTimeout(function() { |
---|
47 | document.body.removeChild(a); |
---|
48 | window.URL.revokeObjectURL(url); |
---|
49 | }, 1500); |
---|
50 | } |
---|
51 | } |
---|
52 | |
---|
53 | render() { |
---|
54 | |
---|
55 | return ( |
---|
56 | <div id = 'end' style={styles.content}> |
---|
57 | <div style={styles.text}>Dziękujemy za udział w badaniu!</div> |
---|
58 | {/*<div> |
---|
59 | <button styles={styles.text} onClick={() => {this.download('text/plain')}}>Pobierz wyniki</button> |
---|
60 | </div>*/} |
---|
61 | </div> |
---|
62 | ); |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | export default EndViewer; |
---|
Note: See
TracBrowser
for help on using the repository browser.