Skip to content

Commit

Permalink
Merge branch 'master' of github.com:pennlabs/penn-courses into pca_re…
Browse files Browse the repository at this point in the history
…syncing
  • Loading branch information
shiva-menta committed Aug 29, 2024
2 parents c20e404 + cf28a29 commit 552fb2e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
1 change: 1 addition & 0 deletions frontend/alert/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const Nav = ({ login, logout, user, page, setPage }: NavProps) => (
nameLength={2}
login={login}
logout={logout}
pathname="/"
/>
</NavElt>
<NavElt
Expand Down
4 changes: 4 additions & 0 deletions frontend/degree-plan/components/Dock/Dock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import AccountIndicator from "pcx-shared-components/src/accounts/AccountIndicato
import _ from 'lodash';
import CoursePlanned from '../FourYearPlan/CourseInPlan';
import CourseInDock from './CourseInDock';
import { useRouter } from 'next/router';

const DockWrapper = styled.div`
z-index: 1;
Expand Down Expand Up @@ -143,6 +144,8 @@ const Dock = ({ user, login, logout, activeDegreeplanId }: DockProps) => {
// }
// }, [isMount, dockedCourses]);

const { asPath } = useRouter();

return (
<DockWrapper ref={drop} >
<DockContainer $isDroppable={canDrop} $isOver={isOver}>
Expand All @@ -154,6 +157,7 @@ const Dock = ({ user, login, logout, activeDegreeplanId }: DockProps) => {
login={login}
logout={logout}
dropdownTop={true}
pathname={asPath}
/>
<SearchIconContainer onClick={() => {
setSearchRuleQuery("");
Expand Down
16 changes: 4 additions & 12 deletions frontend/plan/types.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions frontend/shared-components/src/accounts/AccountIndicator.tsx
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down
12 changes: 12 additions & 0 deletions frontend/shared-components/src/types.ts
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 552fb2e

Please sign in to comment.