From 1a8a7f21b1847f0d594ecffc2aed654ecf3fd575 Mon Sep 17 00:00:00 2001 From: "bhavnish.arora" Date: Wed, 29 Jan 2025 20:51:00 +0530 Subject: [PATCH] tailwind issue --- index.html | 1 + package-lock.json | 53 ------------------------------------ src/App.css | 1 + src/components/Coach.jsx | 24 ++++++---------- src/components/LoginForm.jsx | 16 +++++------ src/pages/Login.jsx | 10 +++---- 6 files changed, 24 insertions(+), 81 deletions(-) diff --git a/index.html b/index.html index 6b9d291..a96fc83 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ Admin Dashboard +
diff --git a/package-lock.json b/package-lock.json index 72fa40e..6440c35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -56,7 +55,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -73,7 +71,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -90,7 +87,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -107,7 +103,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -124,7 +119,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -141,7 +135,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -158,7 +151,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -175,7 +167,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -192,7 +183,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -209,7 +199,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -226,7 +215,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -243,7 +231,6 @@ "cpu": [ "mips64el" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -260,7 +247,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -277,7 +263,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -294,7 +279,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -311,7 +295,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -328,7 +311,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -345,7 +327,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -362,7 +343,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -379,7 +359,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -396,7 +375,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -413,7 +391,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -430,7 +407,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -447,7 +423,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -671,7 +646,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -685,7 +659,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -699,7 +672,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -713,7 +685,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -727,7 +698,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -741,7 +711,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -755,7 +724,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -769,7 +737,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -783,7 +750,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -797,7 +763,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -811,7 +776,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -825,7 +789,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -839,7 +802,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -853,7 +815,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -867,7 +828,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -881,7 +841,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -895,7 +854,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -909,7 +867,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -923,7 +880,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1390,7 +1346,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true, "license": "MIT" }, "node_modules/@types/json-schema": { @@ -2209,7 +2164,6 @@ "version": "0.24.2", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.2.tgz", "integrity": "sha512-+9egpBW8I3CD5XPe0n6BfT5fxLzxrlDzqydF3aviG+9ni1lDC/OvMHcxqEFV0+LANZG5R1bFMWfUrjVsdwxJvA==", - "dev": true, "hasInstallScript": true, "license": "MIT", "bin": { @@ -2622,7 +2576,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -3761,7 +3714,6 @@ "version": "3.3.8", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "dev": true, "funding": [ { "type": "github", @@ -4002,7 +3954,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, "license": "ISC" }, "node_modules/possible-typed-array-names": { @@ -4019,7 +3970,6 @@ "version": "8.5.1", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", - "dev": true, "funding": [ { "type": "opencollective", @@ -4243,7 +4193,6 @@ "version": "4.32.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.32.0.tgz", "integrity": "sha512-JmrhfQR31Q4AuNBjjAX4s+a/Pu/Q8Q9iwjWBsjRH1q52SPFE2NqRMK6fUZKKnvKO6id+h7JIRf0oYsph53eATg==", - "dev": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.6" @@ -4510,7 +4459,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -4823,7 +4771,6 @@ "version": "6.0.11", "resolved": "https://registry.npmjs.org/vite/-/vite-6.0.11.tgz", "integrity": "sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==", - "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.24.2", diff --git a/src/App.css b/src/App.css index e69de29..f1d8c73 100644 --- a/src/App.css +++ b/src/App.css @@ -0,0 +1 @@ +@import "tailwindcss"; diff --git a/src/components/Coach.jsx b/src/components/Coach.jsx index c5eaed5..a1cf8db 100644 --- a/src/components/Coach.jsx +++ b/src/components/Coach.jsx @@ -8,16 +8,13 @@ const Coach = () => { const [message, setMessage] = useState(""); const [editingId, setEditingId] = useState(null); - const API_BASE_URL = import.meta.env.VITE_API_BASE_URL - - const DEBUG = false; + const API_BASE_URL = import.meta.env.VITE_API_BASE_URL; // Fetch coaches const fetchCoaches = async () => { try { - const response = await fetch(API_BASE_URL+"/coach"); + const response = await fetch(API_BASE_URL + "/coach"); const data = await response.json(); - DEBUG && console.log(`fetchCoaches.response`,response); if (response.ok) { setCoaches(data.data); } else { @@ -70,16 +67,13 @@ const Coach = () => { return; } try { - const response = await fetch( - `${API_BASE_URL}/coach/${editingId}`, - { - method: "PUT", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify({ name, title }), - } - ); + const response = await fetch(`${API_BASE_URL}/coach/${editingId}`, { + method: "PUT", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ name, title }), + }); const data = await response.json(); diff --git a/src/components/LoginForm.jsx b/src/components/LoginForm.jsx index d2b8d14..4aef1a5 100644 --- a/src/components/LoginForm.jsx +++ b/src/components/LoginForm.jsx @@ -3,21 +3,21 @@ import { toast } from "react-toastify"; import { useNavigate } from "react-router-dom"; const LoginForm = () => { - const [username,setUsername ] = useState(""); + const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); const navigate = useNavigate(); const handleLogin = () => { - const validEmail = "test"; - const validPassword = "test@123"; + const validEmail = process.env.VITE_USERNAME; + const validPassword = process.env.VITE_PASSWORD; if (username === validEmail && password === validPassword) { toast.success("Login successful!"); - navigate("/dashboard"); - } else { + navigate("/dashboard"); + } else { toast.error("Invalid credentials. Please try again."); } - }; + }; return (
@@ -28,7 +28,7 @@ const LoginForm = () => {
{ id="username" placeholder="Enter Your Username" value={username} - onChange={(e) => setUsername (e.target.value)} + onChange={(e) => setUsername(e.target.value)} />
diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx index df095d5..06bbad9 100644 --- a/src/pages/Login.jsx +++ b/src/pages/Login.jsx @@ -2,17 +2,17 @@ import React from "react"; import LoginForm from "../components/LoginForm"; const Login = () => { - return ( + return (
- +
-
-
+
+
); }; -export default Login; \ No newline at end of file +export default Login;