Skip to content

Commit

Permalink
docs: remove useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
junghyeonsu committed Sep 12, 2024
1 parent e66775a commit 82c6fe8
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions docs/gatsby-browser.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "./src/styles/global.css";

import type { WrapPageElementBrowserArgs } from "gatsby";
import { useEffect } from "react";

import Layout from "./src/_Layout";
import Root from "./src/_Root";
Expand All @@ -13,23 +12,6 @@ export const wrapPageElement = ({
const pathname = props.location.pathname;
const layoutType = pathname === "/" ? "main" : "document";

useEffect(() => {
if (window.location.hostname === "seed-design.pages.dev") {
window.location.replace(`https://seed-design.io${pathname}`);
}
}, []);

useEffect(() => {
if (
pathname.startsWith("/component") &&
pathname.endsWith("/") &&
!pathname.includes("usage") &&
!pathname.includes("style")
) {
window.location.replace(`${pathname}usage/`);
}
}, []);

return (
<Root>
<Layout type={layoutType}>{element}</Layout>
Expand Down

0 comments on commit 82c6fe8

Please sign in to comment.