From 5a4ffa01e6927d2ee25581efb28557577dd63153 Mon Sep 17 00:00:00 2001 From: nftchance Date: Mon, 14 Nov 2022 17:45:56 -0600 Subject: [PATCH] fix: clean up --- .gitignore | 1 + src/hooks/useApplications.js | 4 +--- src/papers/Paper.js | 20 +++++--------------- src/papers/Papers.js | 6 ------ 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 4d29575..8692cf6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ # misc .DS_Store +.env .env.local .env.development.local .env.test.local diff --git a/src/hooks/useApplications.js b/src/hooks/useApplications.js index 5aafdd6..c60ba13 100644 --- a/src/hooks/useApplications.js +++ b/src/hooks/useApplications.js @@ -1,6 +1,4 @@ export const postApplication = async (application) => { - const url = "https://discord.com/api/webhooks/1040463575132668055/87P4hfq1ueEnJ5aVpiCMLVPdTLakpiqvNLRPNQrmIVGUTIxD0g6dFAxHx6SAXy9lQVF-"; - // create a single embed with all the data const fields = Object.entries(application).map(([key, value]) => { const name = key.replace(/_/g, ' '); @@ -20,7 +18,7 @@ export const postApplication = async (application) => { embeds: [embed], }; - const response = await fetch(url, { + const response = await fetch(process.env.REACT_APP_DISCORD_URL, { method: "POST", headers: { "Content-Type": "application/json", diff --git a/src/papers/Paper.js b/src/papers/Paper.js index 5032eda..6e7215c 100644 --- a/src/papers/Paper.js +++ b/src/papers/Paper.js @@ -1,12 +1,12 @@ import Markdown from 'markdown-to-jsx'; -import { useEffect } from 'react'; import { useQuery } from 'react-query'; import { useParams } from 'react-router-dom'; import { fetchPaper } from "../hooks/usePapers"; import Meta from '../seo/Meta'; +import Title from '../title/Title'; import PaperCode from './PaperCode'; import useMousePosition from '../hooks/useMousePosition'; @@ -20,21 +20,16 @@ const Paper = () => { const [ref, mousePosition] = useMousePosition(); - useEffect(() => { - document.documentElement.style.setProperty('--x', `${mousePosition.left}%`); - document.documentElement.style.setProperty('--y', `${mousePosition.top}%`); - }, [mousePosition]); - return ( <> {
-
-
-

{query?.data?.attributes?.title}

-
-
-
- + + <h4 className="attributes">{query?.data?.attributes?.date} | {query?.data?.attributes?.author}</h4> {query?.data?.content && <Markdown className="markdown" options={{ diff --git a/src/papers/Papers.js b/src/papers/Papers.js index e2b0c84..c539186 100644 --- a/src/papers/Papers.js +++ b/src/papers/Papers.js @@ -1,4 +1,3 @@ -import { useEffect } from 'react'; import { useQuery } from 'react-query'; import { Link } from 'react-router-dom'; @@ -20,11 +19,6 @@ const Papers = () => { const [ref, mousePosition] = useMousePosition(); - useEffect(() => { - document.documentElement.style.setProperty('--x', `${mousePosition.left}%`); - document.documentElement.style.setProperty('--y', `${mousePosition.top}%`); - }, [mousePosition]); - return ( <> <Meta title={title} description={description} />