Skip to content

Commit

Permalink
feat: module redirect and /ios page
Browse files Browse the repository at this point in the history
  • Loading branch information
junglesub committed Aug 23, 2024
1 parent 5946a9d commit f604c65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
12 changes: 10 additions & 2 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRoot } from "react-dom/client";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import App from "./App.jsx";
import "./index.css";
import Form from "./pages/Form.jsx";
import { redirectHandler } from "./pages/RedirectPage.jsx";

const router = createBrowserRouter(
[
Expand All @@ -13,7 +13,15 @@ const router = createBrowserRouter(
},
{
path: "/form",
element: <Form />,
element: redirectHandler(
"https://docs.google.com/forms/d/e/1FAIpQLScoN19fAklBenQlIPES3KYiInuK26iAkyHka6iPTnPdFRKwlQ/viewform?usp=sf_link"
),
},
{
path: "/ios",
element: redirectHandler(
"https://apps.apple.com/app/%EB%B9%A0%EB%A5%B8-%EC%83%81%EC%83%81%EB%9E%A9/id6648756420"
),
},
],
{
Expand Down
8 changes: 3 additions & 5 deletions src/pages/Form.jsx → src/pages/RedirectPage.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import React, { useEffect } from "react";

const linkUrl =
"https://docs.google.com/forms/d/e/1FAIpQLScoN19fAklBenQlIPES3KYiInuK26iAkyHka6iPTnPdFRKwlQ/viewform?usp=sf_link";

function Form() {
function RedirectPage({ linkUrl }) {
useEffect(() => {
window.location.replace(linkUrl);
});
Expand All @@ -18,4 +15,5 @@ function Form() {
);
}

export default Form;
export default RedirectPage;
export const redirectHandler = (linkUrl) => <RedirectPage linkUrl={linkUrl} />;

0 comments on commit f604c65

Please sign in to comment.