Skip to content

Conversation

@crsstha
Copy link
Collaborator

@crsstha crsstha commented Dec 30, 2025

  • Addresses Authentication
  • Depends on Backend

Changes

  • Added Login flow
  • Added Logout flow
  • Added Navbar
  • Added Naviagtion Sidebar
  • Page Layout
  • Routes

This PR doesn't introduce any

  • temporary files, auto-generated files or secret keys
  • build works
  • eslint issues
  • typescript issues
  • codegen errors
  • console.log meant for debugging
  • typos
  • unwanted comments
  • conflict markers

This PR includes

  • Translation

<Button
name="logout"
variant="tertiary"
className={styles.dropdownOption}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disable button when fetching. Change variable name to logoutPending

Comment on lines +28 to +32
const toggleAccordion = (index: number) => {
setOpenIndexes((prev) => (prev.includes(index)
? prev.filter((i) => i !== index)
: [...prev, index]));
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use useCallback

type="button"
className={styles.navHeaderContainer}
childrenContainerClassName={styles.navHeader}
onClick={() => toggleAccordion(index)}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onClick={() => toggleAccordion(index)}
onClick={toggleAccordion}

)}
>
<Button
name={item.title}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name={item.title}
name={index}


}
function Navigation({ navigationItem }: { navigationItem: NavigationItem[] }) {
const [openIndexes, setOpenIndexes] = useState(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of open indexes can we use the name of the button? or the link?

import UserContext from '#contexts/UserContext';
import { useLoginMutation } from '#generated/types/graphql';

import banner from '../../resources/image/redCrossBanner.png';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new absolute route for resources


const error = getErrorObject(formError);

const [{ fetching }, triggerLogin] = useLoginMutation();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [{ fetching }, triggerLogin] = useLoginMutation();
const [{ loginPending }, triggerLogin] = useLoginMutation();

});
navigate('/');
} else {
setError({ email: 'Failed to login!' });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also show and alert

<Image src={banner} />
<form
className={styles.loginForm}
onSubmit={(e) => { e.preventDefault(); handleFormSubmit(); }}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a separate handler instead of having inline functions. Avoid inlines as much as possible.

.leftPane {
display: flex;
flex-direction: column;
box-shadow: 0px 4px 4px 0px rgba(227, 227, 227, 0.25);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid this if possible. If not, then its fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants