From b52856784421aed3439505444170f9a7e9574218 Mon Sep 17 00:00:00 2001 From: Suvodip Ghosh Date: Tue, 10 Jun 2025 12:04:58 +0530 Subject: [PATCH] add env file --- .astro/types.d.ts | 1 - .gitignore | 3 +++ env.txt | 2 ++ src/components/Auth/EmailVerification.jsx | 2 -- src/components/Auth/SignInPhase.jsx | 1 - src/components/Auth/SignUp/SignUp.jsx | 5 ++--- src/components/Home/Home.jsx | 1 + src/components/environments/environments.js | 3 +++ src/components/purchase/Checkout/PaymentPage.jsx | 5 ++--- .../purchase/Checkout/PurchaseConfirmationPage.jsx | 4 +--- src/components/purchase/Checkout/UserVerification.jsx | 4 +--- 11 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 env.txt diff --git a/.astro/types.d.ts b/.astro/types.d.ts index 03d7cc4..f964fe0 100644 --- a/.astro/types.d.ts +++ b/.astro/types.d.ts @@ -1,2 +1 @@ /// -/// \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7329a85..bccc309 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ pnpm-debug.log* # macOS-specific files .DS_Store + +# env variables +.env diff --git a/env.txt b/env.txt new file mode 100644 index 0000000..d237a17 --- /dev/null +++ b/env.txt @@ -0,0 +1,2 @@ +PUBLIC_API_KEY=1234567890abcdef +PUBLIC_SECRET_KEY=my-secret-key \ No newline at end of file diff --git a/src/components/Auth/EmailVerification.jsx b/src/components/Auth/EmailVerification.jsx index d4ec9f6..4833020 100644 --- a/src/components/Auth/EmailVerification.jsx +++ b/src/components/Auth/EmailVerification.jsx @@ -9,7 +9,6 @@ import { TOKEN_NAME } from "../../utils/constants"; useNavigate; -import { useNavigate } from "react-router-dom"; import { toast } from "react-toastify"; const EmailVerification = ({ @@ -17,7 +16,6 @@ const EmailVerification = ({ dataSet, showFromPublicRoute = true, }) => { - const navigate = useNavigate(); const dispatch = useDispatch(); const [showSendOtp, setShowSendOtp] = React.useState(true); diff --git a/src/components/Auth/SignInPhase.jsx b/src/components/Auth/SignInPhase.jsx index c08f10e..a124afe 100644 --- a/src/components/Auth/SignInPhase.jsx +++ b/src/components/Auth/SignInPhase.jsx @@ -4,7 +4,6 @@ import { unwrapResult } from "@reduxjs/toolkit"; import { useFormik } from "formik"; import * as React from "react"; import { useDispatch } from "react-redux"; -// import { useNavigate } from "react-router-dom"; import { toast } from "react-toastify"; import validator from "validator"; import BuzzInput from "../BuzzInput/BuzzInput"; diff --git a/src/components/Auth/SignUp/SignUp.jsx b/src/components/Auth/SignUp/SignUp.jsx index 8cc5b3b..fa03125 100644 --- a/src/components/Auth/SignUp/SignUp.jsx +++ b/src/components/Auth/SignUp/SignUp.jsx @@ -3,7 +3,6 @@ import { makeStyles } from "@mui/styles"; import { unwrapResult } from "@reduxjs/toolkit"; import React from "react"; import { useDispatch, useSelector } from "react-redux"; -import { Link, useNavigate } from "react-router-dom"; import { toast } from "react-toastify"; import validator from "validator"; import BuzzInput from "../../../components/BuzzInput/BuzzInput"; @@ -105,9 +104,9 @@ const SignUpScreen = () => { Already have an account?{" "} - + SignIn - + { window.scrollTo({ top: 0, behavior: "instant" }); }, []); + return (
diff --git a/src/components/environments/environments.js b/src/components/environments/environments.js index ee0473e..fecdae3 100644 --- a/src/components/environments/environments.js +++ b/src/components/environments/environments.js @@ -5,3 +5,6 @@ export const API_BASE_BUZZ = import.meta.env.VITE_BUZZ_BASE_URL; export const AUTH_TOKEN = () => localStorage.getItem(TOKEN_NAME); export const SCHOOL_ID = () => localStorage.getItem("SCHOOL_ID"); + +console.log('TestENV', import.meta.env.PUBLIC_API_KEY); +console.log('TestENV', import.meta.env.PUBLIC_SECRET_KEY); diff --git a/src/components/purchase/Checkout/PaymentPage.jsx b/src/components/purchase/Checkout/PaymentPage.jsx index 694f54e..6ad6d50 100644 --- a/src/components/purchase/Checkout/PaymentPage.jsx +++ b/src/components/purchase/Checkout/PaymentPage.jsx @@ -14,7 +14,6 @@ import Header from "../../../components/Header/Header"; import CartSummaryCard from "../components/CartSummaryCard/CartSummaryCard"; import { useDispatch, useSelector } from "react-redux"; -import { useNavigate } from "react-router-dom"; import { clearPurchaseCart, initiatePayment, @@ -25,7 +24,6 @@ import style from "./PaymentPage.module.css"; function PaymentPage() { const dispatch = useDispatch(); - const navigate = useNavigate(); const { purchaseDetails, userDetails } = useSelector(({ purchase }) => { return { @@ -72,7 +70,8 @@ function PaymentPage() { if (res.status === "success") { setPhase(3); dispatch(clearPurchaseCart()); - navigate("/purchase/confirmation"); + // navigate("/purchase/confirmation"); + window.location.href = "/purchase/confirmation"; breakFlag = true; } diff --git a/src/components/purchase/Checkout/PurchaseConfirmationPage.jsx b/src/components/purchase/Checkout/PurchaseConfirmationPage.jsx index b872a1a..ecaba78 100644 --- a/src/components/purchase/Checkout/PurchaseConfirmationPage.jsx +++ b/src/components/purchase/Checkout/PurchaseConfirmationPage.jsx @@ -2,14 +2,12 @@ import React from "react"; import { ArrowForwardOutlined } from "@mui/icons-material"; import { Button } from "@mui/material"; -import { useNavigate } from "react-router-dom"; import style from "./PurchaseConfirmationPage.module.css"; function PurchaseConfirmationPage() { - const navigate = useNavigate(); const redirectToHome = () => { - navigate("/"); + window.location.href = "/"; }; return ( diff --git a/src/components/purchase/Checkout/UserVerification.jsx b/src/components/purchase/Checkout/UserVerification.jsx index b2b5d9f..9bbbc12 100644 --- a/src/components/purchase/Checkout/UserVerification.jsx +++ b/src/components/purchase/Checkout/UserVerification.jsx @@ -9,7 +9,6 @@ import Header from "../../../components/Header/Header"; import CartSummaryCard from "../components/CartSummaryCard/CartSummaryCard"; import { useDispatch, useSelector } from "react-redux"; -import { useNavigate } from "react-router-dom"; import { toast } from "react-toastify"; import { postVerificationSteps, @@ -23,7 +22,6 @@ import style from "./UserVerification.module.css"; function UserVerificationPage() { const dispatch = useDispatch(); - const navigate = useNavigate(); const { purchaseDetails, userDetails, isUserVerified } = useSelector( ({ purchase, auth }) => { @@ -75,7 +73,7 @@ function UserVerificationPage() { }; const navigateToNextPage = () => { - navigate("/purchase/payment"); + window.location.href = "/purchase/payment"; }; return (