Skip to content

Commit 5267613

Browse files
committed
add hash parsing to config
1 parent bd3cc72 commit 5267613

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/app/bigtextconfig/page.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"use client";
2-
import React, { useState } from "react";
2+
import React, { useState, useEffect } from "react";
33
import Image from "next/image";
44
import { LargeTextInputComponent } from "./LargeTextInputComponent";
55
import { LargeButtonComponent } from "./LargeButtonComponent";
@@ -12,6 +12,12 @@ export default function Page() {
1212
const [fullscreenContent, setFullscreenContent] = useState("");
1313
const [orientation, setOrientation] = useState<"horizontal" | "vertical" | undefined>("horizontal");
1414
const [isFullscreen, setFullscreen] = useState(false);
15+
16+
useEffect(() => {
17+
const hash = decodeURI(window.location.hash) ?? "";
18+
setText(hash.replace(/^#/, ""));
19+
}, []);
20+
1521
return (<div className={styles.page}>
1622
<div className={[styles.BigTextConfig, isFullscreen ? styles.hidden : undefined].filter(item => item).join(" ")}>
1723
<LargeTextInputComponent

0 commit comments

Comments
 (0)