-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import Button from 'react-bootstrap/Button' | ||
import { useAuth } from 'web/src/auth' | ||
|
||
import { Link, routes } from '@redwoodjs/router' | ||
|
||
import Navigation from 'src/components/Navigation/Navigation' | ||
|
@@ -7,12 +10,43 @@ type AuthenticatedLayoutProps = { | |
} | ||
|
||
const AuthenticatedLayout = ({ children }: AuthenticatedLayoutProps) => { | ||
const { isAuthenticated, currentUser, logOut } = useAuth() | ||
Check failure on line 13 in web/src/layouts/AuthenticatedLayout/AuthenticatedLayout.tsx GitHub Actions / qa / Lint JavaScript
Check failure on line 13 in web/src/layouts/AuthenticatedLayout/AuthenticatedLayout.tsx GitHub Actions / qa / Lint JavaScript
Check notice Code scanning / CodeQL Unused variable, import, function or class Note
Unused variable isAuthenticated.
Check notice Code scanning / CodeQL Unused variable, import, function or class Note
Unused variable currentUser.
|
||
|
||
return ( | ||
<div className="container-fluid" style={{ width: '90%' }}> | ||
<nav className="row navbar navbar-light bg-light"> | ||
<Link to={routes.uploads()} className="navbar-brand"> | ||
CPF Reporter: USDR | ||
</Link> | ||
<nav className="row navbar navbar-light bg-light d-flex justify-content-between"> | ||
<div className="col"> | ||
<Link to={routes.uploads()} className="navbar-brand"> | ||
CPF Reporter: USDR | ||
</Link> | ||
</div> | ||
<div className="col d-flex justify-content-end"> | ||
{/* Replace the code below when authentication is complete */} | ||
<div className="navbar-text">[email protected]</div> | ||
<Button | ||
size="sm" | ||
variant="link" | ||
className="nav-link navbar-text mx-2" | ||
onClick={logOut} | ||
> | ||
Logout | ||
</Button> | ||
|
||
{/* Use the code below for conditional currentUser logic */} | ||
{/* {isAuthenticated && ( | ||
<> | ||
<div className="navbar-text">{currentUser.email}</div> | ||
<Button | ||
size="sm" | ||
variant="link" | ||
className="nav-link navbar-text mx-2" | ||
onClick={logOut} | ||
> | ||
Logout | ||
</Button> | ||
</> | ||
)} */} | ||
</div> | ||
</nav> | ||
<Navigation /> | ||
|
||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
|
||
import LoginPage from './LoginPage' | ||
|
||
const meta: Meta<typeof LoginPage> = { | ||
component: LoginPage, | ||
} | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof LoginPage> | ||
|
||
export const Primary: Story = {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { render } from '@redwoodjs/testing/web' | ||
|
||
import LoginPage from './LoginPage' | ||
|
||
// Improve this test with help from the Redwood Testing Doc: | ||
// https://redwoodjs.com/docs/testing#testing-pages-layouts | ||
|
||
describe('LoginPage', () => { | ||
it('renders successfully', () => { | ||
expect(() => { | ||
render(<LoginPage />) | ||
}).not.toThrow() | ||
}) | ||
}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useAuth } from 'web/src/auth' | ||
Check failure on line 1 in web/src/pages/LoginPage/LoginPage.tsx GitHub Actions / qa / Lint JavaScript
Check notice Code scanning / CodeQL Unused variable, import, function or class Note
Unused import useAuth.
|
||
|
||
import { Link, routes } from '@redwoodjs/router' | ||
import { MetaTags } from '@redwoodjs/web' | ||
|
||
const LoginPage = () => { | ||
return ( | ||
<> | ||
<MetaTags title="Login" description="Login page" /> | ||
|
||
<h1>LoginPage</h1> | ||
<p> | ||
Find me in <code>./web/src/pages/LoginPage/LoginPage.tsx</code> | ||
</p> | ||
<p> | ||
My default route is named <code>login</code>, link to me with ` | ||
<Link to={routes.login()}>Login</Link>` | ||
</p> | ||
</> | ||
) | ||
} | ||
|
||
export default LoginPage |