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 sidebar, links hidden when user is signed out #149

Merged
merged 12 commits into from
Jul 27, 2023

Conversation

KotovSyndrome
Copy link
Contributor

@KotovSyndrome KotovSyndrome commented Jul 18, 2023

  • Sidebar displays on all pages
  • Links only work when user is signed in
  • All links go to their namesake pages

Co-authored by: Hannah McGowan [email protected]

@KotovSyndrome KotovSyndrome marked this pull request as ready for review July 18, 2023 03:57
Copy link
Contributor

@amantri amantri left a comment

Choose a reason for hiding this comment

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

Please also address the lint warnings in this PR

src/components/case_manager/NavBar.tsx Outdated Show resolved Hide resolved
src/components/case_manager/NavBar.tsx Outdated Show resolved Hide resolved
src/pages/index.tsx Outdated Show resolved Hide resolved
src/pages/students.tsx Outdated Show resolved Hide resolved
src/pages/staff.tsx Outdated Show resolved Hide resolved
src/components/case_manager/PersonTable.tsx Outdated Show resolved Hide resolved
src/components/case_manager/NavBar.tsx Outdated Show resolved Hide resolved
src/components/case_manager/NavBar.tsx Outdated Show resolved Hide resolved
children: React.ReactNode;
}
const NavBar: React.FC<Props> = ({ children }) => {
const { data: me } = trpc.user.getMe.useQuery();
Copy link
Contributor

Choose a reason for hiding this comment

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

While sitting on the sign in page, a 401: Unauthorized error toast pops up because its trying to use getMe without being logged in. Is there a way to prevent this? I think one possibility is to create a new backend procedure for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently investigating our options

Copy link
Contributor

Choose a reason for hiding this comment

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

We can create a separate issue for this, in the spirit of faster and smaller PRs.

package.json Outdated Show resolved Hide resolved
@@ -0,0 +1,11 @@
import React from "react";

const settings = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We recently made the change to make sure all components are PascalCased, so please capitalize first letters.

import styles from "../../styles/Dashboard.module.css";
import MyParas from "@/components/case_manager/MyParas";

function staff() {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto


function cmDashboard() {
function students() {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

<Logout className={styles.icon} />
<p
className={styles.linkTitle}
onClick={() => signOut({ callbackUrl: "/" })}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this on a p tag inside a link? Can the Link just be a button instead?

@KotovSyndrome KotovSyndrome merged commit fd38806 into main Jul 27, 2023
3 checks passed
jonahchoi pushed a commit that referenced this pull request Jul 28, 2023
* Created sidebar, links hidden when user is signed out
>
>
Co-authored by: Hannah McGowan <[email protected]

* added links to student and para tables, settings page under construction

* redirect to students page upon login

* updated table title

* ran prettier on navbar styles

* added type to Navbar props

* resolved all issues except 401 error, fixed linting

* removed React.FC, updated prop type

* Pascal Casing

* updated component exports

* Fixed export casing
@KotovSyndrome KotovSyndrome deleted the sidebar-updated branch July 31, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
4 participants