From 1f8317b57b0e3b81e921480997c4fd40a783bf39 Mon Sep 17 00:00:00 2001 From: Archerman1 Date: Tue, 12 Nov 2024 09:55:18 -0500 Subject: [PATCH] Onboarding --- src/App.tsx | 50 ++++++------ src/components/UserCard.tsx | 153 ++++++++++++++++++++++++++++-------- src/components/UserData.tsx | 87 +++++++++----------- 3 files changed, 180 insertions(+), 110 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 18ac09d..ea6f83b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,60 +1,56 @@ -/* eslint-disable */ import React from "react"; import "./App.css"; import { Routes, Route } from "react-router-dom"; import axios from "axios"; import { initializeApp } from "firebase/app"; import { setPersistence, getAuth, inMemoryPersistence } from "firebase/auth"; -import { useLogin, LoadingScreen, AuthProvider } from "@hex-labs/core"; +import { + useLogin, + LoadingScreen, + AuthProvider, + Header, + Footer +} from "@hex-labs/core"; +import { ChakraProvider, Flex, Box } from "@chakra-ui/react"; import UserData from './components/UserData'; -// a little bee ascii art -// const art = -// ".' '. buzz buzz\n. . . (__\\ \n . . . -{{_(|8)\n ' . . ' ' . . ' (__/"; - -// Initialized the Firebase app through the credentials provided export const app = initializeApp({ apiKey: "AIzaSyCsukUZtMkI5FD_etGfefO4Sr7fHkZM7Rg", authDomain: "auth.hexlabs.org", }); -// Sets the Firebase persistence to in memory since we use cookies for session -// management. These cookies are set by the backend on login/logout. setPersistence(getAuth(app), inMemoryPersistence); - -// By default sends axios requests with user session cookies so that the backend -// can verify the user's identity. axios.defaults.withCredentials = true; export const App = () => { - // Retrieves the user's login state. This hook will also make requests to log - // the user in const [loading, loggedIn] = useLogin(app); - // If loading, show a loading screen if (loading) { return ; } - // If the user is not logged in, redirect to the login frontend with a redirect - // param so that the user can login and come back to the page they were on. if (!loggedIn) { window.location.href = `https://login.hexlabs.org?redirect=${window.location.href}`; return ; } - // Sets up the AuthProvider so that any part of the application can use the - // useAuth hook to retrieve the user's login details. return ( - - - {/* Setting up our React Router to route to all the different pages we may have */} - - } /> - - - + + + +
+ header.Original +
+ + + } /> + + +