feat: V2 with TypeScript

This commit is contained in:
Ben Elferink
2024-12-14 16:14:14 +02:00
parent f6c0a52ab5
commit a41cab872f
63 changed files with 13390 additions and 35925 deletions

43
client/src/App.tsx Normal file
View File

@@ -0,0 +1,43 @@
import React, { Fragment } from 'react'
import { useAuth } from 'contexts/AuthContext'
import AuthModal from 'components/AuthModal'
import Header from 'components/Header'
import logo from 'assets/react.svg'
import 'styles/ReactWelcome.css'
const App = () => {
return (
<div className='App'>
<Header />
<ReactWelcome />
<LoggedInStatus />
<AuthModal />
</div>
)
}
const ReactWelcome = () => {
return (
<Fragment>
<img src={logo} className='ReactWelcome-logo' alt='logo' />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a className='ReactWelcome-link' href='https://reactjs.org' target='_blank' rel='noopener noreferrer'>
Learn React
</a>
</Fragment>
)
}
const LoggedInStatus = () => {
const { isLoggedIn, account } = useAuth()
if (isLoggedIn && !!account) {
return <p>Hey, {account.username}! I'm happy to let you know: you are authenticated!</p>
}
return <p>Don't forget to start your backend server, and then authenticate yourself.</p>
}
export default App