Skip to content
Snippets Groups Projects
Commit 0845831c authored by lcross2002's avatar lcross2002
Browse files

dashboard timeout bugfix + add home page text

parent 67d85ab7
No related branches found
No related tags found
No related merge requests found
.home {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.home-card {
display: flex;
align-items: center;
justify-content: center;
width: 80vw;
height: 90%;
min-width: 350px;
background-color: var(--light);
text-align: center;
p {
font-size: 1.75rem;
}
}
import './Home.scss';
function Home() {
return (
<>
<div className='home'>
<div className='card home-card'>
<p>Welcome to Airline Booking!</p>
<p>This website allows you to create and book domestic flights in the UK</p>
<p>If you are new please navigate to the register page via the link in the header</p>
<p>Happy flying</p>
</div>
</div>
</>
);
}
export default Home;
...@@ -15,6 +15,7 @@ body { ...@@ -15,6 +15,7 @@ body {
/* CSS Variables */ /* CSS Variables */
:root { :root {
--main: #000055; --main: #000055;
--light: hsla(240, 100%, 17%, 0.299);
} }
/* /*
......
...@@ -30,6 +30,7 @@ import CustomerProtectedRoute from "./components/ProtectedRoute/CustomerProtecte ...@@ -30,6 +30,7 @@ import CustomerProtectedRoute from "./components/ProtectedRoute/CustomerProtecte
import AirlineProtectedRoute from "./components/ProtectedRoute/AirlineProtectedRoute.tsx"; import AirlineProtectedRoute from "./components/ProtectedRoute/AirlineProtectedRoute.tsx";
import ErrorPage404 from "./components/ErrorPage/ErrorPage404.tsx"; import ErrorPage404 from "./components/ErrorPage/ErrorPage404.tsx";
import ErrorPage from "./components/ErrorPage/ErrorPage.tsx"; import ErrorPage from "./components/ErrorPage/ErrorPage.tsx";
import Home from "./components/Home/Home.tsx";
import { loadStripe } from '@stripe/stripe-js'; import { loadStripe } from '@stripe/stripe-js';
loadStripe('pk_test_51P5UhOExQclpActcEGkHdut1X1k6uQnEXQ2cKKTD5l9FS9a1TyB2ap1lRSQXZt35Dpd7mh8gHOwFyVb4TiqpZfJr00bDRrD4vF'); loadStripe('pk_test_51P5UhOExQclpActcEGkHdut1X1k6uQnEXQ2cKKTD5l9FS9a1TyB2ap1lRSQXZt35Dpd7mh8gHOwFyVb4TiqpZfJr00bDRrD4vF');
...@@ -41,6 +42,10 @@ const router = createBrowserRouter([ ...@@ -41,6 +42,10 @@ const router = createBrowserRouter([
element: <App></App>, element: <App></App>,
errorElement: <ErrorPage></ErrorPage>, errorElement: <ErrorPage></ErrorPage>,
children: [ children: [
{
path: "",
element: <Home></Home>
},
{ {
element: <InverseProtectedRoute></InverseProtectedRoute>, element: <InverseProtectedRoute></InverseProtectedRoute>,
children: [ children: [
......
...@@ -48,7 +48,17 @@ export async function GetCustomerDashboardData(): Promise<ICustomerDashboardData ...@@ -48,7 +48,17 @@ export async function GetCustomerDashboardData(): Promise<ICustomerDashboardData
flightsHistory: hData.data flightsHistory: hData.data
}; };
} catch (error) { } catch (error) {
throw error; try {
const upcomingFlights = Api.get('Booking/upcoming', { withCredentials: true });
const flightsHistory = Api.get('Booking/history', { withCredentials: true });
const [uData, hData] = await Promise.all([upcomingFlights, flightsHistory]);
return {
type: 'customer',
upcomingFlights: uData.data,
flightsHistory: hData.data
};
} catch (newError) {
throw newError;
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment