Skip to content

Commit

Permalink
deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
majkeloess committed Feb 17, 2024
1 parent a5d581e commit 3bcfe6d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16
node-version: 20

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
8 changes: 4 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Year from "./Year.tsx";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import Logo from "./Logo.tsx";
import DataFetcher from "./DataFetcher.tsx";
import ErrorPage from "./ErrorPage.tsx";
// import ErrorPage from "./ErrorPage.tsx";

interface QueryClientOptions {
defaultOptions: {
Expand Down Expand Up @@ -54,9 +54,9 @@ function App() {
</div>
}
/>
<Route path="/prize/:year" element={<Year />} />
<Route path="*" element={<ErrorPage />} />
<Route path="/error" element={<ErrorPage />} />
<Route path="/nobelPrize/prize/:year" element={<Year />} />
{/* <Route path="*" element={<ErrorPage />} />
<Route path="/error" element={<ErrorPage />} /> */}
</Routes>
<Footer />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/Logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Link } from "react-router-dom";
export default function Logo() {
return (
<>
<Link to="/">
<Link to="/nobelPrize">
<div className="flex flex-col justify-center align-middle p-5 w-[325px]">
<p className="text-6xl font-medium">nobelPrize</p>
<p className="text-xl self-end">1901-1905</p>
Expand Down
18 changes: 9 additions & 9 deletions src/Year.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useParams, useNavigate } from "react-router-dom";
import { useParams } from "react-router-dom";
import BasicTable from "./Table";
import { useContext, useEffect } from "react";
import { useContext } from "react";
import YearContext from "./Context";

export default function Year() {
Expand All @@ -10,16 +10,16 @@ export default function Year() {
throw new Error("Error in Year el");
}

const { years } = yearContext;
// const { years } = yearContext;

const { year } = useParams<{ year: string }>();
const navigate = useNavigate();
// const navigate = useNavigate();

useEffect(() => {
if (year && !years.includes(year)) {
navigate("/error");
}
}, [year, years, navigate]);
// useEffect(() => {
// if (year && !years.includes(year)) {
// navigate("/error");
// }
// }, [year, years, navigate]);

return (
<div className="bg-[radial-gradient(ellipse_at_top_left,_var(--tw-gradient-stops))] from-black via-black to-yellow-600 h-screen w-screen overflow-hidden">
Expand Down

0 comments on commit 3bcfe6d

Please sign in to comment.