BrowserBar.tsx 2.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import React, { FunctionComponent, memo } from 'react';
import ContentEditable from 'react-contenteditable';

import { browserInfoConfig } from '../browserConfig';

import styles from './BrowserBar.scss';

type BrowserBarProps = {
  browserNavOpened: boolean;
  expanded: boolean;
  toggleBrowserNav: () => void;
};

const BrowserBar: FunctionComponent<BrowserBarProps> = memo(
  (props: BrowserBarProps) => {
    const { navigator, reset } = browserInfoConfig;

    return (
      <div className={styles.browserBar}>
        <div className={styles.browserInfo}>
          <dl className={styles.browserInfoLeft}>
            <dd className={styles.resetButton}>
              <button>
                <img src={reset.icon.default} alt={reset.description} />
              </button>
            </dd>
            <dd className={styles.geneSymbol}>
              <label>Gene</label>
              <span className={styles.value}>BRAC2</span>
            </dd>
            <dd>
              <label>Stable ID</label>
              <span className={styles.value}>ENSG00000139618</span>
            </dd>
            <dd>
              <label>Spliced mRNA length</label>
              <span className={styles.value}>84,793</span>
              <label>bp</label>
            </dd>
            <dd>protein coding</dd>
            <dd>forward strand</dd>
          </dl>
          <dl className={styles.browserInfoRight}>
            <dd>
              <label>Chromosome</label>
              <ContentEditable html={'13'} className="content-editable-box" />
              <ContentEditable html={'32,315,474 - 32,400,266'} />
            </dd>
            <dd className={styles.navigator}>
              <button
                title={navigator.description}
                onClick={props.toggleBrowserNav}
              >
                <img
                  src={
                    props.browserNavOpened
                      ? navigator.icon.selected
                      : navigator.icon.default
                  }
                  alt={navigator.description}
                />
              </button>
            </dd>
          </dl>
        </div>
        <dl className={styles.browserTabs}>
          <dd>
            <button className={styles.active}>Key Data</button>
          </dd>
          <dd>
            <button>Variation</button>
          </dd>
          <dd>
            <button>Expression</button>
          </dd>
        </dl>
      </div>
    );
  }
);

export default BrowserBar;