Skip to content

Commit 3cae86c

Browse files
committed
fix: in react ui, add Back to Top and use secondary styling for source button
Signed-off-by: Nick Mitchell <[email protected]>
1 parent 649a3f4 commit 3cae86c

File tree

4 files changed

+11
-20
lines changed

4 files changed

+11
-20
lines changed

pdl-live-react/src/page/Page.css

Lines changed: 0 additions & 15 deletions
This file was deleted.

pdl-live-react/src/page/Page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import DarkModeContext, {
1414
getDarkModeUserSetting,
1515
} from "./DarkModeContext"
1616

17-
import "./Page.css"
18-
1917
const withPadding = { default: "padding" as const }
2018
const withoutPadding = { default: "noPadding" as const }
2119

@@ -40,6 +38,7 @@ export default function PDLPage(props: Props) {
4038
const showingDetail = searchParams.has("detail") && !!value
4139

4240
if (value) {
41+
// Fail fast if `value` is bogus
4342
JSON.parse(value)
4443
}
4544

pdl-live-react/src/view/masonry/MasonryTimelineCombo.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useMemo, useState } from "react"
2-
import { PageSection } from "@patternfly/react-core"
2+
import { BackToTop, PageSection } from "@patternfly/react-core"
33

44
import Timeline from "../timeline/TimelineFromModel"
55

@@ -49,13 +49,15 @@ export default function MasonryTimelineCombo({ block }: Props) {
4949
<PageSection
5050
isFilled
5151
hasOverflowScroll
52-
className="pdl-content-section"
52+
className="pdl-content-section pdl-masonry-page-section"
5353
aria-label="PDL Viewer main section"
5454
>
5555
<Masonry model={masonry} as={as} sml={sml}>
5656
<Timeline model={base} numbering={numbering} />
5757
</Masonry>
5858
</PageSection>
59+
60+
<BackToTop scrollableSelector=".pdl-masonry-page-section" />
5961
</>
6062
)
6163
}

pdl-live-react/src/view/masonry/ToolbarShowSourceButton.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ export default function ToolbarProgramOrSourceToggle() {
1515

1616
return (
1717
<Tooltip content="Show program source">
18-
<Button size="sm" icon={<CodeIcon />} onClick={handleClickSource} />
18+
<Button
19+
size="sm"
20+
variant="secondary"
21+
icon={<CodeIcon />}
22+
onClick={handleClickSource}
23+
/>
1924
</Tooltip>
2025
)
2126
}

0 commit comments

Comments
 (0)