diff --git a/.env b/.env index f1c80035..8738dd00 100644 --- a/.env +++ b/.env @@ -1,3 +1,4 @@ VITE_SUPABASE_URL=https://lkkownkrbkmblczeoyqb.supabase.co VITE_SUPABASE_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJvbGUiOiJhbm9uIiwiaWF0IjoxNjQyNDU2MTc0LCJleHAiOjE5NTgwMzIxNzR9.c6nlkT05GnNacQ6OYuGcjBsILmGsSDwEEtN2zZVXFgY -VITE_POSTHOG_ID=phc_DFcN3mLP4ocKAUBKr5xyMbAnPwcl93q41ZmhoLG7GCv \ No newline at end of file +VITE_POSTHOG_ID=phc_DFcN3mLP4ocKAUBKr5xyMbAnPwcl93q41ZmhoLG7GCv +VITE_API_URL=https://beta.api.opensauced.pizza/v1 diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e9d3f576..4b9b7a55 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -454,6 +454,7 @@ module.exports = { }, ], "@typescript-eslint/promise-function-async": "error", + "@typescript-eslint/no-non-null-assertion": "off", }, settings: { react: { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e96a4509..54b00244 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -20,8 +20,10 @@ "react-dom": "^18.2.0", "react-hot-toast": "^2.3.0", "react-icons": "^4.4.0", + "react-loading-skeleton": "^3.1.0", "react-router-dom": "^6.3.0", "rooks": "^6.1.0", + "swr": "^1.3.0", "tailwindcss": "^3.1.7", "tailwindcss-radix": "^2.4.0" }, @@ -7251,6 +7253,14 @@ "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", "dev": true }, + "node_modules/react-loading-skeleton": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/react-loading-skeleton/-/react-loading-skeleton-3.1.0.tgz", + "integrity": "sha512-j1U1CWWs68nBPOg7tkQqnlFcAMFF6oEK6MgqAo15f8A5p7mjH6xyKn2gHbkcimpwfO0VQXqxAswnSYVr8lWzjw==", + "peerDependencies": { + "react": ">=16.8.0" + } + }, "node_modules/react-refresh": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", @@ -8015,6 +8025,14 @@ "node": ">=10.13.0" } }, + "node_modules/swr": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/swr/-/swr-1.3.0.tgz", + "integrity": "sha512-dkghQrOl2ORX9HYrMDtPa7LTVHJjCTeZoB1dqTbnnEDlSvN8JEKpYIYurDfvbQFUUS8Cg8PceFVZNkW0KNNYPw==", + "peerDependencies": { + "react": "^16.11.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/systemjs": { "version": "6.12.1", "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.12.1.tgz", diff --git a/package.json b/package.json index 5a75c2d7..baff22c0 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,10 @@ "react-dom": "^18.2.0", "react-hot-toast": "^2.3.0", "react-icons": "^4.4.0", + "react-loading-skeleton": "^3.1.0", "react-router-dom": "^6.3.0", "rooks": "^6.1.0", + "swr": "^1.3.0", "tailwindcss": "^3.1.7", "tailwindcss-radix": "^2.4.0" }, diff --git a/src/App.tsx b/src/App.tsx index 38a72305..0dd310ae 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,22 +1,28 @@ -import { useState } from "react"; import Footer from "./components/Footer"; import PrimaryNav from "./components/PrimaryNav"; import PostsWrap from "./components/PostsWrap"; import { initiatePostHog } from "./lib/analytics"; import { BrowserRouter } from "react-router-dom"; import { Toaster } from "react-hot-toast"; +import { SWRConfig } from "swr"; import RepoSubmission from "./components/RepoSubmission"; import GradBackground from "./components/GradBackground"; import useSupabaseAuth from "./hooks/useSupabaseAuth"; import Hero from "./components/Hero"; +import apiFetcher from "./hooks/useSWR"; const App = (): JSX.Element => { - initiatePostHog(); const { user } = useSupabaseAuth(); - const [textToSearch] = useState(""); + + initiatePostHog(); return ( - <> + @@ -29,12 +35,12 @@ const App = (): JSX.Element => { - +