From f55a69e0e6a40e968b883f39e4bf18274d4922e7 Mon Sep 17 00:00:00 2001 From: vashujoshi <118829508+vashujoshi@users.noreply.github.com> Date: Sat, 9 Nov 2024 22:19:43 +0530 Subject: [PATCH 1/2] added my changes --- oathfiles.txt | 2 + package-lock.json | 27 +++++++- package.json | 4 +- src/App.jsx | 2 + src/components/LandingPage.jsx | 122 ++++++++++++++++++--------------- src/components/Login.css | 23 +++++++ src/components/Login.jsx | 22 ++++++ src/main.jsx | 17 ++++- 8 files changed, 160 insertions(+), 59 deletions(-) create mode 100644 oathfiles.txt create mode 100644 src/components/Login.css create mode 100644 src/components/Login.jsx diff --git a/oathfiles.txt b/oathfiles.txt new file mode 100644 index 0000000..8c53976 --- /dev/null +++ b/oathfiles.txt @@ -0,0 +1,2 @@ +dev-eydbckiq4wqvn7iy.us.auth0.com +LslJwFqrmO90hmUV4K4v2Yg63nq4QjNU \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c1095fe..ad752d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "securesure", "version": "0.0.0", "dependencies": { + "@auth0/auth0-react": "^2.2.4", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", "@mui/icons-material": "^6.1.6", @@ -17,7 +18,8 @@ "lucide-react": "^0.456.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router-dom": "^6.28.0" + "react-router-dom": "^6.28.0", + "securesure": "file:" }, "devDependencies": { "@eslint/js": "^9.13.0", @@ -68,6 +70,25 @@ "node": ">=6.0.0" } }, + "node_modules/@auth0/auth0-react": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/@auth0/auth0-react/-/auth0-react-2.2.4.tgz", + "integrity": "sha512-l29PQC0WdgkCoOc6WeMAY26gsy/yXJICW0jHfj0nz8rZZphYKrLNqTRWFFCMJY+sagza9tSgB1kG/UvQYgGh9A==", + "license": "MIT", + "dependencies": { + "@auth0/auth0-spa-js": "^2.1.3" + }, + "peerDependencies": { + "react": "^16.11.0 || ^17 || ^18", + "react-dom": "^16.11.0 || ^17 || ^18" + } + }, + "node_modules/@auth0/auth0-spa-js": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@auth0/auth0-spa-js/-/auth0-spa-js-2.1.3.tgz", + "integrity": "sha512-NMTBNuuG4g3rame1aCnNS5qFYIzsTUV5qTFPRfTyYFS1feS6jsCBR+eTq9YkxCp1yuoM2UIcjunPaoPl77U9xQ==", + "license": "MIT" + }, "node_modules/@babel/code-frame": { "version": "7.26.2", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", @@ -5313,6 +5334,10 @@ "loose-envify": "^1.1.0" } }, + "node_modules/securesure": { + "resolved": "", + "link": true + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", diff --git a/package.json b/package.json index 73556e2..3ae511d 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@auth0/auth0-react": "^2.2.4", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", "@mui/icons-material": "^6.1.6", @@ -19,7 +20,8 @@ "lucide-react": "^0.456.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-router-dom": "^6.28.0" + "react-router-dom": "^6.28.0", + "securesure": "file:" }, "devDependencies": { "@eslint/js": "^9.13.0", diff --git a/src/App.jsx b/src/App.jsx index 01cf6eb..7150355 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -3,6 +3,7 @@ import LandingPage from './components/LandingPage'; import AdminPage from './components/AdminPage'; import HospitalDashboard from './components/HospitalDashboard'; import CompanyDashboard from './components/CompanyDasboard'; +import Login from './components/Login' const App = () => ( @@ -11,6 +12,7 @@ const App = () => ( } /> } /> } /> + } /> ); diff --git a/src/components/LandingPage.jsx b/src/components/LandingPage.jsx index 8e1a2ea..f88825d 100644 --- a/src/components/LandingPage.jsx +++ b/src/components/LandingPage.jsx @@ -1,63 +1,77 @@ import React from 'react'; import { Shield, Lock, Clock, Check, ChevronRight, Database, AlertCircle } from 'lucide-react'; import { motion } from 'framer-motion'; +import { useNavigate } from 'react-router-dom'; // Import useNavigate const LandingPage = () => { - return ( -
- + const navigate = useNavigate(); // Hook for navigation -
-
- -

- Decentralized Smart Insurance - Claim Processing -

-

- Leverage the power of Web3 and Generative AI for transparent, fraud-resistant insurance claims processing. -

-
- - Get Started - - - Learn More - -
-
-
-
+ return ( +
+ + +
+
+ +

+ Decentralized Smart Insurance + Claim Processing +

+

+ Leverage the power of Web3 and Generative AI for transparent, fraud-resistant insurance claims processing. +

+
+ navigate('/login')} // Redirect to the login page + > + Get Started + + + Learn More + +
+
+
+
diff --git a/src/components/Login.css b/src/components/Login.css new file mode 100644 index 0000000..8df0622 --- /dev/null +++ b/src/components/Login.css @@ -0,0 +1,23 @@ +.login-container { + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + background-color: #f0f4f8; /* Light background for better contrast */ + } + + .login-button { + background-color: #1e40af; /* Tailwind's blue-700 */ + color: white; + padding: 12px 24px; + border: none; + border-radius: 8px; + font-size: 16px; + cursor: pointer; + transition: background-color 0.3s; + } + + .login-button:hover { + background-color: #1d4ed8; /* Tailwind's blue-800 */ + } + \ No newline at end of file diff --git a/src/components/Login.jsx b/src/components/Login.jsx new file mode 100644 index 0000000..33976be --- /dev/null +++ b/src/components/Login.jsx @@ -0,0 +1,22 @@ +// Import necessary modules +import { useAuth0 } from "@auth0/auth0-react"; +import React from "react"; + + +function Login() { + // Destructure the loginWithRedirect function from the useAuth0 hook + const { user, loginWithRedirect } = useAuth0(); + + console.log("Current User:", user); // Logs user info if authenticated + + return ( +
+
+ {/* Button to trigger the login with Auth0 */} + +
+
+ ); +} + +export default Login; diff --git a/src/main.jsx b/src/main.jsx index b9a1a6d..581d023 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,10 +1,21 @@ import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' +import { Auth0Provider } from '@auth0/auth0-react'; import './index.css' import App from './App.jsx' createRoot(document.getElementById('root')).render( + + - - , -) + + +, +); + From 625461e316ecb52d0af3b77ecfba87969daf3986 Mon Sep 17 00:00:00 2001 From: vashujoshi <118829508+vashujoshi@users.noreply.github.com> Date: Sat, 9 Nov 2024 22:36:42 +0530 Subject: [PATCH 2/2] modified login --- src/components/Login.jsx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/Login.jsx b/src/components/Login.jsx index 33976be..74000d9 100644 --- a/src/components/Login.jsx +++ b/src/components/Login.jsx @@ -1,22 +1,23 @@ -// Import necessary modules -import { useAuth0 } from "@auth0/auth0-react"; -import React from "react"; +import { useAuth0 } from '@auth0/auth0-react'; function Login() { - // Destructure the loginWithRedirect function from the useAuth0 hook const { user, loginWithRedirect } = useAuth0(); - - console.log("Current User:", user); // Logs user info if authenticated + + console.log("Current User:", user); return ( -
-
- {/* Button to trigger the login with Auth0 */} - +
+
+
); } -export default Login; +export default Login; \ No newline at end of file