mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-07-28 04:08:05 +00:00
app: Generalize docs toggle style.
Allow adding several views to be opened and closed. Also make it easily discoverable by making them the same color as the main buttons.
This commit is contained in:
+17
-16
@@ -142,22 +142,23 @@ const App: React.FunctionComponent = () => {
|
||||
>
|
||||
<Editor />
|
||||
</React.Suspense>
|
||||
<Button
|
||||
className="pb-app-doc-button"
|
||||
minimal
|
||||
large
|
||||
icon={<Manual />}
|
||||
title={
|
||||
sideView === 'docs'
|
||||
? i18n.translate('docs.hide')
|
||||
: i18n.translate('docs.show')
|
||||
}
|
||||
onClick={() =>
|
||||
setSideView(
|
||||
sideView === 'docs' ? 'off' : 'docs',
|
||||
)
|
||||
}
|
||||
/>
|
||||
<div className="pb-app-side-view-buttons">
|
||||
<Button
|
||||
large
|
||||
intent="primary"
|
||||
icon={<Manual />}
|
||||
title={
|
||||
sideView === 'docs'
|
||||
? i18n.translate('docs.hide')
|
||||
: i18n.translate('docs.show')
|
||||
}
|
||||
onClick={() =>
|
||||
setSideView(
|
||||
sideView === 'docs' ? 'off' : 'docs',
|
||||
)
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
<aside
|
||||
className="pb-app-terminal"
|
||||
|
||||
+9
-1
@@ -79,11 +79,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
.pb-app-doc-button {
|
||||
.pb-app-side-view-buttons {
|
||||
position: absolute;
|
||||
bottom: bp.$pt-grid-size;
|
||||
right: bp.$pt-grid-size;
|
||||
z-index: bp.$pt-z-index-overlay;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: bp.$pt-grid-size * 0.5;
|
||||
|
||||
// match toolbar button appearance: no box-shadow border or active-state shadow
|
||||
& * {
|
||||
box-shadow: unset !important;
|
||||
}
|
||||
}
|
||||
|
||||
$splitter-background-color: bp.$light-gray2;
|
||||
|
||||
Reference in New Issue
Block a user