aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web-util/src/stories.tsx')
-rw-r--r--packages/web-util/src/stories.tsx26
1 files changed, 13 insertions, 13 deletions
diff --git a/packages/web-util/src/stories.tsx b/packages/web-util/src/stories.tsx
index 4edbf83b5..d9c2406eb 100644
--- a/packages/web-util/src/stories.tsx
+++ b/packages/web-util/src/stories.tsx
@@ -184,8 +184,8 @@ function ExampleList({
backgroundColor: isSelected
? "green"
: i % 2
- ? "lightgray"
- : "lightblue",
+ ? "lightgray"
+ : "lightblue",
marginLeft: "1em",
padding: 4,
cursor: "pointer",
@@ -395,10 +395,10 @@ function folder(groupName: string, value: ComponentOrFolder): ComponentItem[] {
try {
title =
typeof value === "object" &&
- typeof value.default === "object" &&
- value.default !== undefined &&
- "title" in value.default &&
- typeof value.default.title === "string"
+ typeof value.default === "object" &&
+ value.default !== undefined &&
+ "title" in value.default &&
+ typeof value.default.title === "string"
? value.default.title
: undefined;
} catch (e) {
@@ -430,12 +430,12 @@ function Application({
examplesInGroups,
getWrapperForGroup,
}: Props): VNode {
+ const url = new URL(window.location.href);
const initialSelection = getSelectionFromLocationHash(
- location.hash,
+ url.hash,
examplesInGroups,
);
- const url = new URL(window.location.href);
const currentLang = url.searchParams.get("lang") || "en";
if (!langs["en"]) {
@@ -448,15 +448,15 @@ function Application({
);
const [sidebarWidth, setSidebarWidth] = useState(200);
useEffect(() => {
- if (location.hash) {
- const hash = location.hash.substring(1);
+ if (url.hash) {
+ const hash = url.hash.substring(1);
const found = document.getElementById(hash);
if (found) {
setTimeout(() => {
found.scrollIntoView({
block: "center",
});
- }, 10);
+ }, 50);
}
}
}, []);
@@ -500,11 +500,11 @@ function Application({
))}
<hr />
</SideBar>
- <ResizeHandle
+ {/* <ResizeHandle
onUpdate={(x) => {
setSidebarWidth((s) => s + x);
}}
- />
+ /> */}
<Content>
<ErrorReport selected={selected}>
<PreventLinkNavigation>