-
- {!sidebarCollapsed && (
+
+ {(!sidebarCollapsed || overrideCollapse) && (
{getFullName(firstName, lastName)}
diff --git a/client/src/components/sidebar/friends/UserProfilePicture.tsx b/client/src/components/sidebar/friends/UserProfilePicture.tsx
new file mode 100644
index 000000000..5f3509465
--- /dev/null
+++ b/client/src/components/sidebar/friends/UserProfilePicture.tsx
@@ -0,0 +1,27 @@
+import React from 'react';
+
+export const emptyProfile = 'https://cdn.pixabay.com/photo/2015/10/05/22/37/blank-profile-picture-973460_960_720.png';
+
+type UserProfilePicProps = {
+ profileURL?: string;
+ size?: number;
+ alt?: string;
+};
+
+const UserProfilePicture: React.FC = ({ profileURL, size = 34, alt }) => {
+ return (
+
+ );
+};
+
+export default UserProfilePicture;
diff --git a/client/src/components/sidebar/friends/friends.json b/client/src/components/sidebar/friends/friends.json
index bcd1c99a5..87fb24f1e 100644
--- a/client/src/components/sidebar/friends/friends.json
+++ b/client/src/components/sidebar/friends/friends.json
@@ -1,12 +1,50 @@
[
- "Lucas Harvey",
- "Mark Tran",
- "Ben Quin",
- "Jason Poon",
- "Fritz Rehde",
- "Sunny Chen",
- "Ana Kiperas",
- "Tet Nay Lin",
- "Kai Fox",
- "Meredith Zhang"
+ {
+ "firstName": "Lucas",
+ "lastName": "Harvey",
+ "id": "awbdawiudbwau",
+ "profileURL": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQhaTTHYe3pq6RYazy_xpEmcmxHs1TbwE2ffQ&s"
+ },
+ {
+ "firstName": "Mark",
+ "lastName": "Tran",
+ "id": "daiwhdwoahdwioahd",
+ "profileURL": "https://i.ytimg.com/vi/-hF2qhio5RU/hq720.jpg?sqp=-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD&rs=AOn4CLDd4dOurruzSdr62ADACkYLprW4Og"
+ },
+ {
+ "firstName": "Ana",
+ "lastName": "Kiperas",
+ "id": "21y39821y3hb",
+ "profileURL": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSGYIqf3m4nPGABzXz-gqhB4y76m3wTaqTRDg&s"
+ },
+ {
+ "firstName": "Ben",
+ "lastName": "Quin",
+ "id": "21073y89hujbfeo",
+ "profileURL": "https://t3.ftcdn.net/jpg/01/93/38/40/360_F_193384026_F34lj9rX9W4ixlVZBrTJmijK010Tdv0j.jpg"
+ },
+ {
+ "firstName": "Fritz",
+ "lastName": "Rehde",
+ "id": "2190e7210eyhfboj",
+ "profileURL": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQjSKoyOjhKTNOkbuXv8zhtxMwtpt39UaMmLA&s"
+ },
+ {
+ "firstName": "Jason",
+ "lastName": "Poon",
+ "id": "2109ey218yeh21boj",
+ "profileURL": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRIDQU7kqSBdt3uSRwJhB7wKs8nOC2VvEnuuQ&s"
+ },
+ {
+ "firstName": "Sunny",
+ "lastName": "Chen",
+ "id": "028y3812y3h21be",
+ "profileURL": "https://pbs.twimg.com/profile_images/1311008414156423170/Kxu_7mQS_400x400.jpg"
+ },
+ {
+ "firstName": "Guest",
+ "lastName": "User",
+ "id": "203u21ihenlkn2",
+ "profileURL": ""
+ }
]
diff --git a/client/src/index.tsx b/client/src/index.tsx
index 04db2070f..829f334d5 100644
--- a/client/src/index.tsx
+++ b/client/src/index.tsx
@@ -75,6 +75,19 @@ const Root: React.FC = () => {
>
} />
+
+ }>
+
+
+
+ {import.meta.env.MODE === 'development' && }
+
+
+ }
+ path="/friend/:friendId"
+ />
diff --git a/server/src/auth/auth.service.ts b/server/src/auth/auth.service.ts
index 9c6d9d696..2595ec321 100644
--- a/server/src/auth/auth.service.ts
+++ b/server/src/auth/auth.service.ts
@@ -35,7 +35,7 @@ export class AuthService {
if (provider === undefined || subject === undefined) {
throw new Error('Provider and subject must be defined for auth users');
}
- const currentYear = new Date().getFullYear().toString();
+ const currentYear = new Date().getFullYear();
const { availableTerms } =
await this.graphql.getAvailableTermsFrom(currentYear);
if (availableTerms.length === 0) {
@@ -75,7 +75,7 @@ export class AuthService {
}
private async createGuest(params: OnboardParams): Promise {
- const currentYear = new Date().getFullYear().toString();
+ const currentYear = new Date().getFullYear();
const { availableTerms } =
await this.graphql.getAvailableTermsFrom(currentYear);
if (availableTerms.length === 0) {
@@ -96,6 +96,7 @@ export class AuthService {
name: this.TIMETABLE_DEFAULT_NAME,
year,
term,
+ primary: true,
};
}),
},
diff --git a/server/src/graphql/graphql.service.ts b/server/src/graphql/graphql.service.ts
index 1d0168d36..78779eae5 100644
--- a/server/src/graphql/graphql.service.ts
+++ b/server/src/graphql/graphql.service.ts
@@ -29,7 +29,7 @@ export class GraphqlService {
}
async getAvailableTermsFrom(
- currentYear: string = new Date().getFullYear().toString(),
+ currentYear: number = new Date().getFullYear(),
): Promise<{ availableTerms: string[] }> {
const result = await this.sdk.GetAvailableTerms({
currentYear: currentYear,
diff --git a/server/src/graphql/queries.ts b/server/src/graphql/queries.ts
index 52f8c31f8..3adeb9e7c 100644
--- a/server/src/graphql/queries.ts
+++ b/server/src/graphql/queries.ts
@@ -22,7 +22,7 @@ export const CLASS_DETAILS = gql(`
`);
export const GET_AVAILABLE_TERMS = gql(`
- query GetAvailableTerms($currentYear: String!) {
+ query GetAvailableTerms($currentYear: Int!) {
classes(
where: {term: {_in: ["T1", "T2", "T3", "U1"]}, year: {_gte: $currentYear}}
distinct_on: offering_period