diff --git a/React/real-estate/src/index.css b/React/real-estate/src/index.css
index 1b632c3..97b18a2 100644
--- a/React/real-estate/src/index.css
+++ b/React/real-estate/src/index.css
@@ -1,7 +1,7 @@
-@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display&display=swap");
+@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Roboto:wght@300;400;500;700&display=swap");
:root {
- --blue: #2170b9;
+ --blue: #343b99;
--black: #1a1c21;
}
@@ -19,7 +19,9 @@ p,
}
.font-playfair {
- font-family: "Playfair Display", serif;
+ font-family: "Roboto", sans-serif;
+ font-weight: 500;
+ color: var(--blue) !important;
}
.text-black-custom {
@@ -37,7 +39,7 @@ h6 {
}
button:hover {
- background-color: #1d6ab1;
+ background-color: var(--blue);
border: none;
}
diff --git a/React/real-estate/src/pages/components/Card.js b/React/real-estate/src/pages/components/Card.js
index 8d8ec5b..eb375d4 100644
--- a/React/real-estate/src/pages/components/Card.js
+++ b/React/real-estate/src/pages/components/Card.js
@@ -4,7 +4,7 @@ const Card = ({ children, classes = "", styles = {} }) => {
return (
{children}
diff --git a/React/real-estate/src/pages/components/LoginWindow.js b/React/real-estate/src/pages/components/LoginWindow.js
index 12c2c26..2d7ef2c 100644
--- a/React/real-estate/src/pages/components/LoginWindow.js
+++ b/React/real-estate/src/pages/components/LoginWindow.js
@@ -24,7 +24,8 @@ const LoginWindow = () => {
- Login to your account to view your dashboard and register a new vehicle.
+ Login to your account to view your dashboard and manage your real
+ estate.
diff --git a/React/real-estate/src/pages/components/Navbar.js b/React/real-estate/src/pages/components/Navbar.js
index e2b48b0..fde21c9 100644
--- a/React/real-estate/src/pages/components/Navbar.js
+++ b/React/real-estate/src/pages/components/Navbar.js
@@ -53,7 +53,7 @@ const Navbar = () => {
className="text-white font-inter font-semibold hover:text-white focus:text-white tracking-normal mr-20"
style={{ fontSize: "1.335rem" }}
>
- Your Vehicles
+ Your Real Estates
@@ -62,7 +62,7 @@ const Navbar = () => {
className="text-white font-inter font-semibold hover:text-white focus:text-white tracking-normal mr-20"
style={{ fontSize: "1.335rem" }}
>
- Register A Vehicles
+ Register Real Estates
{
const history = useHistory();
- // Initial state must be null ** Temporary **
- const [vehicleData, setVehicleData] = useState([
- {
- id: Math.floor(Math.random() * 200) + 1,
- color: "White",
- model: "Toyota Camry",
- licensePlate: "14324235",
- type: 2,
- },
- {
- id: Math.floor(Math.random() * 200) + 1,
- color: "Black",
- model: "Honda Accord",
- licensePlate: "8765658",
- type: 1,
- },
- {
- id: Math.floor(Math.random() * 200) + 1,
- color: "Beige",
- model: "Toyota Corolla",
- licensePlate: "235464",
- type: 2,
- },
- {
- id: Math.floor(Math.random() * 200) + 1,
- color: "Grey",
- model: "Toyota Yaris",
- licensePlate: "1878767",
- type: 2,
- },
- {
- id: Math.floor(Math.random() * 200) + 1,
- color: "White",
- model: "Toyota Camry",
- licensePlate: "9956443",
- type: 1,
- },
- ]);
+ const [vehicleData, setVehicleData] = useState(null);
useEffect(() => {
getVehicles();
@@ -67,9 +30,13 @@ const VehiclesMain = () => {
}
return (
-
+
{
{/* Hello, {user.profile.given_name}.
*/}
{vehicleData ? (
<>
- Your Vehicles:
+
+ Your Vehicles:
+ history.push("/register")}
+ />
+
>
) : (
@@ -86,11 +60,12 @@ const VehiclesMain = () => {
No vehicles yet.
)}
- history.push("/register")}
- />
+ {!vehicleData && (
+ history.push("/register")}
+ />
+ )}
);
};
diff --git a/React/real-estate/src/services/apiService.js b/React/real-estate/src/services/apiService.js
index b5cb213..d23ba82 100644
--- a/React/real-estate/src/services/apiService.js
+++ b/React/real-estate/src/services/apiService.js
@@ -1,17 +1,20 @@
-import axios from 'axios'
+import axios from "axios";
async function getVehiclesFromApi(access_token) {
- const response = await axios.get(`https://localhost:6001/api/Vehicles`, { headers: { 'Authorization': `Bearer ${access_token}` } });
+ const response = await axios.get(`https://localhost:8000/real-estate`, {
+ headers: { Authorization: `Bearer ${access_token}` },
+ });
return response.data;
}
async function registerVehicle(vehicle, access_token) {
console.log(vehicle);
- const response = await axios.post(`https://localhost:6001/api/Vehicles`, vehicle, { headers: { 'Authorization': `Bearer ${access_token}` } });
+ const response = await axios.post(
+ `https://localhost:8000/real-estate`,
+ vehicle,
+ { headers: { Authorization: `Bearer ${access_token}` } }
+ );
return response.data;
}
-export {
- getVehiclesFromApi,
- registerVehicle
-}
+export { getVehiclesFromApi, registerVehicle };