From 96102c9d31db7619d829da03b4b2a65da9d66895 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 19 Dec 2023 20:28:02 -0300 Subject: [PATCH] login pronto con profile page --- public/index.html | 2 +- src/App.css | 10 ++- src/App.js | 8 +- src/api/apiService.js | 24 +++++- src/components/general/Header.js | 57 +++++++++++-- src/components/general/NotFound.js | 9 +++ src/components/home/Layout.js | 124 +++++++++++++++++++++++++++-- src/components/login/Layout.js | 112 ++++++++++++++++++++++++++ src/components/profile/Layout.js | 16 ++++ src/images/dbp_logo.png | Bin 0 -> 315544 bytes 10 files changed, 343 insertions(+), 19 deletions(-) create mode 100644 src/components/general/NotFound.js create mode 100644 src/components/login/Layout.js create mode 100644 src/components/profile/Layout.js create mode 100644 src/images/dbp_logo.png diff --git a/public/index.html b/public/index.html index aa069f2..32bc68e 100644 --- a/public/index.html +++ b/public/index.html @@ -24,7 +24,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - React App + Permiso de Construcción Digital | PI-ATI-ORT diff --git a/src/App.css b/src/App.css index 0a81a04..8f161d6 100644 --- a/src/App.css +++ b/src/App.css @@ -4,4 +4,12 @@ .verde-idem { color: #5CBE81; -} \ No newline at end of file + } + +.text-idem { + color: #5CBE81; + } + +.border-idem { + border-color: #5CBE81; + } \ No newline at end of file diff --git a/src/App.js b/src/App.js index 087309b..2795880 100644 --- a/src/App.js +++ b/src/App.js @@ -4,8 +4,10 @@ import "./App.css"; import Header from "./components/general/Header"; import Home from "./components/home/Layout"; -// import Login from "./components/login/Layout"; +import Login from "./components/login/Layout"; import Register from "./components/register/Layout"; +import Profile from "./components/profile/Layout"; +import NotFound from "./components/general/NotFound"; function App() { return ( @@ -16,8 +18,10 @@ function App() { } /> - {/* } /> */} + } /> } /> + } /> + } /> diff --git a/src/api/apiService.js b/src/api/apiService.js index 77eda53..892cb23 100644 --- a/src/api/apiService.js +++ b/src/api/apiService.js @@ -12,4 +12,26 @@ export const registerUser = async (user) => { console.error("Error registering user:", error); throw error; } -}; \ No newline at end of file +}; + +export const loginUser = async (user) => { + try { + const response = await axios.post("http://localhost:8080/auth/login", user); + return response.data; + } catch (error) { + console.error("Error login in: ", error); + throw error; + } +}; + +export const getUser = async (username) => { + try { + const response = await axios.get( + `http://localhost:8080/users/${username}` + ); + return response.data; + } catch (error) { + console.error("Error getting user: ", error); + throw error; + } +} diff --git a/src/components/general/Header.js b/src/components/general/Header.js index 6cc1068..ea606c7 100644 --- a/src/components/general/Header.js +++ b/src/components/general/Header.js @@ -4,18 +4,59 @@ import "./header.css"; import logo from "../../images/logo_imm.png"; const Header = () => { - const goToHome = (e) => { e.preventDefault(); window.location.href = "/"; - } - + }; + return ( -
-