forked from GreenPioneer/nx_firebase_template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
52 changed files
with
2,409 additions
and
1,065 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
/* Your styles goes here. */ | ||
body { | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
// body { | ||
// min-height: 100vh; | ||
// display: flex; | ||
// flex-direction: column; | ||
// } | ||
|
||
// .page { | ||
// height: 100vh; | ||
// display: grid; | ||
// grid-template-rows: 40px 137px 98px 66px 116px 66px 96px 106px; | ||
// } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,94 @@ | ||
import React, { useEffect } from 'react'; | ||
import React, { useEffect, useState } from 'react'; | ||
import { BrowserRouter } from 'react-router-dom'; | ||
import Footer from './components/footer/footer'; | ||
// import Header from './components/header/header'; | ||
import Header from './components/header/header'; | ||
import Router from './views/router/router'; | ||
import { AssetProvider } from './views/assets/AssetContext'; | ||
import './app.module.scss'; | ||
// import { UpdateAssets } from './views/assets/UpdateAssets'; | ||
import { AssetsInput } from './views/assets/AssetsInput'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any | ||
export const UserContext = React.createContext({user: {firstName: null, lastName: null, id: null, joinDate: null, email: null, userType: 'Reader', picture: null, name: null, roles: ['None']}, setUser: (user: any) => {}}); | ||
export const UserContext = React.createContext({ | ||
user: { | ||
firstName: null, | ||
lastName: null, | ||
id: null, | ||
joinDate: null, | ||
email: null, | ||
userType: 'Reader', | ||
picture: null, | ||
name: null, | ||
roles: ['None'], | ||
}, | ||
setUser: (user: any) => {}, | ||
}); | ||
|
||
|
||
export function App() { | ||
|
||
const [user, setUser] = React.useState<any>({firstName: null, lastName: null, id: null, joinDate: null, email: null, userType: 'Reader', picture: null, name: null, roles: ['None']}); | ||
|
||
export function App() { | ||
const [user, setUser] = React.useState<any>({ | ||
firstName: null, | ||
lastName: null, | ||
id: null, | ||
joinDate: null, | ||
email: null, | ||
userType: 'Reader', | ||
picture: null, | ||
name: null, | ||
roles: ['None'], | ||
}); | ||
|
||
useEffect(() => { | ||
const user = localStorage.getItem('user'); | ||
if(user){ | ||
if (user) { | ||
setUser(JSON.parse(user)); | ||
} | ||
}, []) | ||
}, []); | ||
|
||
useEffect(() => { | ||
console.log(user) | ||
}, [user]) | ||
console.log(user); | ||
}, [user]); | ||
|
||
// this is for cypress testing, to have a test user logged in | ||
useEffect(() => { | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
if(window.Cypress){ | ||
const user = {firstName: 'Test', lastName: 'User', id: 'test', joinDate: '05/05/2023', email: 'testUser@test.com', userType: 'Reader', picture: 'www.google.com', name: 'Test User', roles: ['None']} | ||
setUser(user) | ||
if (window.Cypress) { | ||
const user = { | ||
firstName: 'Test', | ||
lastName: 'User', | ||
id: 'test', | ||
joinDate: '05/05/2023', | ||
email: 'testUser@test.com', | ||
userType: 'Reader', | ||
picture: 'www.google.com', | ||
name: 'Test User', | ||
roles: ['None'], | ||
}; | ||
setUser(user); | ||
} | ||
}, []) | ||
}, []); | ||
|
||
return ( | ||
<UserContext.Provider value={{user, setUser}}> | ||
<BrowserRouter> | ||
<div className="flex flex-col h-screen"> | ||
<div style={{ flex: '1 1 0' }}> | ||
{/* <Header></Header> */} | ||
<Router></Router> | ||
</div> | ||
<Footer></Footer> | ||
</div> | ||
</BrowserRouter> | ||
</UserContext.Provider> | ||
// <UserContext.Provider value={{ user, setUser }}> | ||
// {/* <AssetProvider value={{assets, setAssets, saveAssets, removeAsset, getAllAssets, addNewAsset }} > */} | ||
// {/* <UpdateAssets /> */} | ||
|
||
<BrowserRouter> | ||
<div className="flex flex-col h-screen"> | ||
<div style={{ flex: '1 1 0' }}> | ||
<Header></Header> | ||
<Router></Router> | ||
|
||
</div> | ||
|
||
</div> | ||
</BrowserRouter> | ||
// {/* </AssetProvider> */} | ||
// </UserContext.Provider> | ||
); | ||
} | ||
|
||
export default App; | ||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
apps/frontend/src/app/components/hamburger-nav/HamburgerNav.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, { useContext } from 'react'; | ||
import crystalBall from '../../images/dash/crystal-ball.svg'; | ||
import lineList from '../../images/dash/line-md_list-3-filled.svg'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
import './hamburger.css'; | ||
|
||
interface HamburgerNavProps { | ||
show: boolean; | ||
} | ||
|
||
const HamburgerNav: React.FC<HamburgerNavProps> = ({ show }) => { | ||
return ( | ||
<div className={`sidebar ${show ? 'show' : ''}`}> | ||
<aside id="FlyoutMenuRoot" className="fly-out-menu-root"> | ||
<div className="ham-trademark-container"> | ||
<div id="W" className="ham-trademark-letter"> | ||
W | ||
</div> | ||
<img | ||
src={lineList} | ||
alt="lineList" | ||
id="lineList" | ||
className="ham-trademark-symbol" | ||
/> | ||
<div id="L" className="ham-trademark-letter"> | ||
L | ||
</div> | ||
<div className="ham-vertical-line"> | ||
" | ||
<img | ||
src={crystalBall} | ||
alt="CrystalBall" | ||
id="CrystalBall" | ||
className="ham-crystalball mb-0 mt-1" | ||
/> | ||
</div> | ||
</div> | ||
<div className="link-container"> | ||
<div className="hamburger-link"> | ||
<Link to="/dashboard">Dashboard</Link> | ||
</div> | ||
<div className="hamburger-link"> | ||
<Link to="/">Cash Flow</Link> | ||
</div> | ||
<div className="hamburger-link"> | ||
<Link to="/assets">Assets</Link> | ||
</div> | ||
<div className="hamburger-link"> | ||
<Link to="/">Liabilities</Link> | ||
</div> | ||
<div className="hamburger-link"> | ||
<Link to="/">Logout</Link> | ||
</div> | ||
<div className="hamburger-link"> | ||
<Link to="/">Settings</Link> | ||
</div> | ||
</div> | ||
</aside> | ||
</div> | ||
); | ||
}; | ||
export default HamburgerNav; |
Oops, something went wrong.