-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathGoldenLayout.tsx
More file actions
56 lines (52 loc) · 1.61 KB
/
GoldenLayout.tsx
File metadata and controls
56 lines (52 loc) · 1.61 KB
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
import React from 'react';
import classnames from 'classnames';
import SampleSection from './SampleSection';
const tabs = ['Tab 1', 'Tab 2', 'Tab 3'];
function Tab({
isActive,
title,
}: {
isActive: boolean;
title: string;
}): JSX.Element {
return (
<li className={classnames('lm_tab', isActive && 'lm_active')}>
<span className="lm_title_before" />
<span className="lm_title">{title}</span>
<span className="lm_close_tab" />
</li>
);
}
export function GoldenLayout(): JSX.Element {
return (
<SampleSection name="golden-layout">
<h2 className="ui-title">Golden Layout</h2>
{[false, true].map(isMaximised => (
<React.Fragment key={String(isMaximised)}>
<h5>{isMaximised ? 'Minimized' : 'Maximised'}</h5>
<div
style={{ position: 'relative', border: 'none' }}
className={isMaximised ? 'lm_maximised' : undefined}
>
<div className="lm_header">
<ul className="lm_tabs">
{tabs.map((tab, i) => (
<Tab key={tab} isActive={i === 0} title={tab} />
))}
</ul>
<ul className="lm_controls">
<li className="lm_tabpreviousbutton" />
<li className="lm_tabnextbutton" />
<li className="lm_maximise" />
<li className="lm_popout" />
<li className="lm_tabdropdown" />
<li className="lm_close" />
</ul>
</div>
</div>
</React.Fragment>
))}
</SampleSection>
);
}
export default GoldenLayout;