Skip to content

Commit f23f498

Browse files
committed
lint and add flex wrapper
1 parent b9f4008 commit f23f498

File tree

1 file changed

+39
-33
lines changed

1 file changed

+39
-33
lines changed

src/App.jsx

+39-33
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@ import Results from './Results';
1515
import TabHeaders, { Tab } from './Tabs';
1616

1717
function App() {
18-
const fullScreenHandle = useFullScreenHandle()
19-
const [fullScreen, setFullScreen] = useState(false)
20-
const [walkThroughVisible, setWalkThroughVisible] = useState(false)
21-
const [demosVisible, setDemosVisible] = useState(false)
18+
const fullScreenHandle = useFullScreenHandle();
19+
const [fullScreen, setFullScreen] = useState(false);
20+
const [demosVisible, setDemosVisible] = useState(false);
2221

2322
const handleToggleFullScreen = () => {
2423
if (fullScreen) {
25-
fullScreenHandle.exit()
26-
setFullScreen(false)
24+
fullScreenHandle.exit();
25+
setFullScreen(false);
2726
} else {
28-
fullScreenHandle.enter()
29-
setFullScreen(true)
27+
fullScreenHandle.enter();
28+
setFullScreen(true);
3029
}
31-
}
30+
};
3231

3332
const tabs = ["laboratory", "details", "results", "help"];
3433
const [activeTab, setActiveTab] = useState("laboratory");
@@ -38,31 +37,38 @@ function App() {
3837

3938
return (
4039
<FullScreen handle={fullScreenHandle} className="fullscreen-class">
41-
<div style={{height: '100%'}}>
42-
<div className="tab-body">
43-
<Tab active={activeTab === "laboratory"}>
44-
<Laboratory />
45-
</Tab>
46-
<Tab active={activeTab === "details"}>
47-
<Details />
48-
</Tab>
49-
<Tab active={activeTab === "results"}>
50-
<Results />
51-
</Tab>
52-
<Tab active={activeTab === 'help'}>
53-
<Help />
54-
</Tab>
55-
</div>
56-
<TabHeaders
57-
tabs={tabs}
58-
activeTab={activeTab}
59-
onTabClick={handleTabClick}
60-
onShowWalkThrough={() => setWalkThroughVisible(true)}
61-
onToggleDemos={() => setDemosVisible(v => !v)}
62-
onToggleFullScreen={handleToggleFullScreen}
63-
/>
40+
<div
41+
style={{
42+
height: "100%",
43+
display: "flex",
44+
flexDirection: "column",
45+
overflow: "hidden",
46+
justifyContent: 'space-between'
47+
}}
48+
>
49+
<div className="tab-body">
50+
<Tab active={activeTab === "laboratory"}>
51+
<Laboratory />
52+
</Tab>
53+
<Tab active={activeTab === "details"}>
54+
<Details />
55+
</Tab>
56+
<Tab active={activeTab === "results"}>
57+
<Results />
58+
</Tab>
59+
<Tab active={activeTab === "help"}>
60+
<Help />
61+
</Tab>
6462
</div>
65-
{demosVisible && <Demos onClose={() => setDemosVisible(false)}/>}
63+
<TabHeaders
64+
tabs={tabs}
65+
activeTab={activeTab}
66+
onTabClick={handleTabClick}
67+
onToggleDemos={() => setDemosVisible((v) => !v)}
68+
onToggleFullScreen={handleToggleFullScreen}
69+
/>
70+
</div>
71+
{demosVisible && <Demos onClose={() => setDemosVisible(false)} />}
6672
</FullScreen>
6773
);
6874
}

0 commit comments

Comments
 (0)