Skip to content

Commit

Permalink
Merge pull request #5 from SpyC0der77/main
Browse files Browse the repository at this point in the history
Update page.jsx
  • Loading branch information
georg-stone authored Oct 21, 2024
2 parents 34f485a + 4af0da5 commit 4b6da15
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion apps/web/src/app/reader/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@ import { ModeToggle } from "@/components/ui/dark-toggle";
import { Input } from "@/components/ui/input";
import { SettingsIcon } from "lucide-react";
import { ChevronLeft } from "lucide-react";
import { useState } from "react";
import { useState, useEffect } from "react";
import { useRouter } from "next/navigation";

export default function Read() {
const [articleUrl, setArticleUrl] = useState("");
const router = useRouter();

useEffect(() => {
// Check if the 'url' parameter exists in the searchParams
const urlParam = new URLSearchParams(window.location.search).get('url');
if (urlParam) {
// Decode and set the URL from the query parameter
setArticleUrl(decodeURIComponent(urlParam));
}
}, []);

return (
<>
<header className="p-2 pl-4 pr-4 flex justify-between gap-4 items-center select-none absolute left-0 right-0 top-0 z-10">
Expand Down

0 comments on commit 4b6da15

Please sign in to comment.