diff --git a/src/App.tsx b/src/App.tsx
index 7743256..97b3739 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -7,12 +7,8 @@ import Blog from './components/Blog';
import Socials from './components/Socials';
import About from './components/About';
import Donate from "./components/Donate"
+import Redirect from './components/Redirect';
-const redirects = [
- {href: "/github", url: "https://github.com/MCorange99"},
- {href: "/ko-fi", url: "https://ko-fi.com/mcorange"},
- {href: "/mastadon", url: "https://river.group.lt/@mcorange"}
-]
const App: Component = () => {
return (
@@ -26,15 +22,15 @@ const App: Component = () => {
-
- {redirects.map((val)=>{
+
+ {/* {redirects.map((val)=>{
return (
{
window.location.assign(val.url);
return (<>>);
}}/>
)
- })}
+ })} */}
diff --git a/src/components/Redirect.tsx b/src/components/Redirect.tsx
index f0c88c8..2d3602d 100644
--- a/src/components/Redirect.tsx
+++ b/src/components/Redirect.tsx
@@ -1,20 +1,22 @@
-import { Route, Router, Routes } from "@solidjs/router";
+import { Route, Router, Routes, useParams } from "@solidjs/router";
+
+const redirects = {
+ "github": "https://github.com/MCorange99",
+ "ko-fi": "https://ko-fi.com/mcorange",
+ "mastadon": "https://river.group.lt/@mcorange",
+};
export default () => {
- const p = window.location.pathname;
- console.log(p);
- if (p.startsWith("/r")) {
- switch (p) {
- case "/r/github":
- redirect("https://github.com/MCorange99");
- break
- }
- }
- return (
- <>
- >
- );
+ const params = useParams();
+ //@ts-ignore
+ const url = (redirects[params["id"] as string] || "/") as string;
+ redirect(url);
+
+ return (
+ Redirecting...
+ )
+
}