diff --git a/frontend/alert/pages/index.tsx b/frontend/alert/pages/index.tsx index 6acf563f2..3f3369f94 100644 --- a/frontend/alert/pages/index.tsx +++ b/frontend/alert/pages/index.tsx @@ -80,6 +80,7 @@ const Nav = ({ login, logout, user, page, setPage }: NavProps) => ( nameLength={2} login={login} logout={logout} + pathname="/" /> { // } // }, [isMount, dockedCourses]); + const { asPath } = useRouter(); + return ( @@ -154,6 +157,7 @@ const Dock = ({ user, login, logout, activeDegreeplanId }: DockProps) => { login={login} logout={logout} dropdownTop={true} + pathname={asPath} /> { setSearchRuleQuery(""); diff --git a/frontend/plan/types.ts b/frontend/plan/types.ts index 2cf2a2b40..abf2c0ffc 100644 --- a/frontend/plan/types.ts +++ b/frontend/plan/types.ts @@ -1,3 +1,7 @@ +import { type User } from "pcx-shared-components/src/types"; + +export { type User } from "pcx-shared-components/src/types"; + export enum School { SEAS = "SEAS", WHARTON = "WH", @@ -123,11 +127,6 @@ export interface MeetingBlock { id?: number; } -export interface Profile { - email: string | null; - phone: string | null; -} - export interface Requirement { id: string; code: string; @@ -168,13 +167,6 @@ export interface Schedule { updated_at: string; } -export interface User { - username: string; - first_name: string; - last_name: string; - profile: Profile; -} - export interface Friendship { sender: User; recipient: User; diff --git a/frontend/shared-components/src/accounts/AccountIndicator.tsx b/frontend/shared-components/src/accounts/AccountIndicator.tsx index 1b262b1d9..6dc9508d4 100644 --- a/frontend/shared-components/src/accounts/AccountIndicator.tsx +++ b/frontend/shared-components/src/accounts/AccountIndicator.tsx @@ -1,7 +1,7 @@ import React, { useEffect } from "react"; import UserSelector from "./UserSelector"; import LoginButton from "./LoginButton"; -import type { User } from "../../../plan/types"; +import type { User } from "../types"; /** * An indicator of whether the user is logged in, and what account they are logged into. @@ -11,7 +11,7 @@ import type { User } from "../../../plan/types"; */ const AccountIndicator: React.FC<{ - user: User; + user: User | null | undefined; login: (user: any) => void; logout: () => void; leftAligned?: boolean; diff --git a/frontend/shared-components/src/types.ts b/frontend/shared-components/src/types.ts new file mode 100644 index 000000000..6706b078f --- /dev/null +++ b/frontend/shared-components/src/types.ts @@ -0,0 +1,12 @@ + +export interface Profile { + email: string | null; + phone: string | null; +} + +export interface User { + username: string; + first_name: string; + last_name: string; + profile: Profile; +} \ No newline at end of file