136 | ))}
137 | (this._pre = ref)} className={styles.pre}>
50 | (this._code = ref)} />
51 |
52 | );
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/client/components/Reporter.css:
--------------------------------------------------------------------------------
1 | @import '../style/colors.css';
2 | @import '../style/variables.css';
3 |
4 | .jsCpa {
5 | /* position: absolute;
6 | width: 100%;
7 | height: 100%; */
8 | }
9 |
10 | .layout {
11 | width: 100%;
12 | height: 100%;
13 | display: flex;
14 | flex-direction: column;
15 | margin-top: 40px;
16 | overflow-y: auto;
17 | overflow-x: hidden;
18 | position: relative;
19 | -webkit-overflow-scrolling: touch;
20 | }
21 |
--------------------------------------------------------------------------------
/client/components/Reporter.jsx:
--------------------------------------------------------------------------------
1 | import { h, Component } from "preact";
2 |
3 | import Header from "./Header";
4 | import Sidebar from "./Sidebar";
5 | import Content from "./Content";
6 |
7 | import styles from "./Reporter.css";
8 |
9 | export default class Reporter extends Component {
10 | constructor(...args) {
11 | super(...args);
12 | this.state = {
13 | reportType: "count",
14 | activeIndex: 0
15 | };
16 |
17 | this.handleItemChange = this.handleItemChange.bind(this);
18 | }
19 |
20 | handleItemChange(index) {
21 | this.setState({ activeIndex: index });
22 | }
23 |
24 | render({ data }, { reportType, activeIndex }) {
25 | const sidebarProps = {
26 | data,
27 | reportType,
28 | handleItemChange: this.handleItemChange,
29 | activeIndex
30 | };
31 | const contentProps = {
32 | data: data[activeIndex]
33 | };
34 | return (
35 |