Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

created login forms for ssf and pantry #10

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions apps/frontend/src/components/forms/loginForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Stack } from '@chakra-ui/react';

const handlePantryLogin = () => {
console.log('Pantry login');
};
const handlePantrySignUp = () => {
console.log('Pantry sign up');
};
const handleSSFLogin = () => {
console.log('SSF login');
};

const PantryLoginForm = () => {
return (
<Stack sx={{ width: '30vw' }} align={'center'}>
<p>Pantry Log in</p>
<Stack sx={{ width: '50%' }}>
<input type="text" placeholder="Username" />
<input type="text" placeholder="Password" />
<button type="submit" onClick={handlePantryLogin}>
Log in
</button>
<button type="submit" onClick={handlePantrySignUp}>
Sign up
</button>
</Stack>
</Stack>
);
};
const SSFLoginForm = () => {
return (
<Stack sx={{ width: '30vw' }} align={'center'}>
<p>SSF Log in</p>
<Stack sx={{ width: '50%' }}>
<input type="text" placeholder="Username" />
<input type="text" placeholder="Password" />
<button type="submit" onClick={handleSSFLogin}>
Log in
</button>
</Stack>
</Stack>
);
};

export { PantryLoginForm, SSFLoginForm };
11 changes: 10 additions & 1 deletion apps/frontend/src/containers/landingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { PantryLoginForm, SSFLoginForm } from '@components/forms/loginForm';
import { useState } from 'react';

const LandingPage: React.FC = () => {
return <>Landing page</>;
const [ssf, setSSF] = useState(false);
return (
<>
{ssf ? <SSFLoginForm /> : <PantryLoginForm />}
<button onClick={() => setSSF(!ssf)}>Switch</button>
</>
);
};

export default LandingPage;
2 changes: 1 addition & 1 deletion apps/frontend/src/containers/root.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Outlet } from 'react-router-dom';
import Header from '../../components/Header';
import Header from '@components/Header';
const Root: React.FC = () => {
return (
<div>
Expand Down