diff --git a/src/app.tsx b/src/app.tsx index 7cd973f..620707c 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -180,7 +180,7 @@ function AppLayout(props: { children: any }) {
{ try { - const bucketString = import.meta.env.VITE_AWS_BUCKET_STRING || ""; + const bucketString = env.VITE_AWS_BUCKET_STRING || ""; await navigator.clipboard.writeText(bucketString + key); console.log("Text copied to clipboard"); } catch (err) { diff --git a/src/components/blog/CommentSectionWrapper.tsx b/src/components/blog/CommentSectionWrapper.tsx index 08a62b2..c724898 100644 --- a/src/components/blog/CommentSectionWrapper.tsx +++ b/src/components/blog/CommentSectionWrapper.tsx @@ -14,6 +14,7 @@ import { api } from "~/lib/api"; import CommentSection from "./CommentSection"; import CommentDeletionPrompt from "./CommentDeletionPrompt"; import EditCommentModal from "./EditCommentModal"; +import { env } from "~/env/client"; const MAX_RETRIES = 12; const RETRY_INTERVAL = 5000; @@ -72,7 +73,7 @@ export default function CommentSectionWrapper( return; } - const websocketUrl = import.meta.env.VITE_WEBSOCKET; + const websocketUrl = env.VITE_WEBSOCKET; if (!websocketUrl) { console.error("VITE_WEBSOCKET environment variable not set"); return; @@ -192,7 +193,7 @@ export default function CommentSectionWrapper( parentCommentID?: number ) => { try { - const domain = import.meta.env.VITE_DOMAIN; + const domain = env.VITE_DOMAIN; const res = await fetch( `${domain}/api/database/comments/create/blog/${props.id}`, { @@ -228,7 +229,7 @@ export default function CommentSectionWrapper( const id = data.commentID; if (body && commenterID && parentCommentID !== undefined && id) { - const domain = import.meta.env.VITE_DOMAIN; + const domain = env.VITE_DOMAIN; const res = await fetch( `${domain}/api/database/user/public-data/${commenterID}` ); diff --git a/src/routes/blog/index.tsx b/src/routes/blog/index.tsx index 85e2a45..eee312f 100644 --- a/src/routes/blog/index.tsx +++ b/src/routes/blog/index.tsx @@ -22,7 +22,7 @@ export default function BlogIndex() {
}> -
+
0}> diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 4daf2b2..b4d02d2 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -10,7 +10,7 @@ export default function Home() { content="Michael Freno - Software Engineer based in Brooklyn, NY. Passionate about dev tooling, game development, and open source software." /> -
+
Hey!
diff --git a/src/routes/login/index.tsx b/src/routes/login/index.tsx index 3ab81e1..555c343 100644 --- a/src/routes/login/index.tsx +++ b/src/routes/login/index.tsx @@ -15,6 +15,7 @@ import EyeSlash from "~/components/icons/EyeSlash"; import CountdownCircleTimer from "~/components/CountdownCircleTimer"; import { isValidEmail, validatePassword } from "~/lib/validation"; import { getClientCookie } from "~/lib/cookies.client"; +import { env } from "~/env/client"; const checkAuth = cache(async () => { "use server"; @@ -63,9 +64,9 @@ export default function LoginPage() { let timerInterval: number | undefined; // Environment variables - const googleClientId = import.meta.env.VITE_GOOGLE_CLIENT_ID; - const githubClientId = import.meta.env.VITE_GITHUB_CLIENT_ID; - const domain = import.meta.env.VITE_DOMAIN || "https://www.freno.me"; + const googleClientId = env.VITE_GOOGLE_CLIENT_ID; + const githubClientId = env.VITE_GITHUB_CLIENT_ID; + const domain = env.VITE_DOMAIN || "https://www.freno.me"; // Calculate remaining time from cookie const calcRemainder = (timer: string) => { @@ -91,12 +92,13 @@ export default function LoginPage() { () => calcRemainder(timer), 1000 ) as unknown as number; - onCleanup(() => { - if (timerInterval) { - clearInterval(timerInterval); - } - }); } + + onCleanup(() => { + if (timerInterval) { + clearInterval(timerInterval); + } + }); }); // Check for OAuth/callback errors in URL @@ -329,7 +331,7 @@ export default function LoginPage() { />
{/* Main content */} -
+
{/* Error message */}
@@ -347,7 +349,7 @@ export default function LoginPage() { +
Already have an account?
} > -
+
Don't have an account yet?
- - {/* Countdown Timer or Submit Button */} - 0} - fallback={ - - } - > -
- false} - > - {renderTime} - -
-
-
- - - {/* Success Message */} -
- If email exists, you will receive an email shortly! -
- - {/* Error Message */} - -
-
{error()}
-
-
- - {/* Back to Login Link */} - + + + {/* Success Message */} +
+ If email exists, you will receive an email shortly! +
+ + {/* Error Message */} + +
+
{error()}
+
+
+ + {/* Back to Login Link */} + );