Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
devksingh4 committed Jul 14, 2024
1 parent 306451d commit 98ab689
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
3 changes: 1 addition & 2 deletions clientv2/src/components/AuthContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
};
const tokenResponse = await instance.acquireTokenSilent(silentRequest);
return tokenResponse.accessToken;
} else {
throw new Error('More than one account found, cannot proceed.');
}
throw new Error('More than one account found, cannot proceed.');
} catch (error) {
console.error('Silent token acquisition failed.', error);
if (error instanceof InteractionRequiredAuthError) {
Expand Down
2 changes: 1 addition & 1 deletion clientv2/src/components/ProfileViewer/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ const otherMajors = [

export const degreeOptions = [
"Associate's",
`Bachelor's`,
'Bachelor\'s',
"Master's (Thesis)",
"Master's (Non-Thesis)",
'PhD',
Expand Down
23 changes: 14 additions & 9 deletions clientv2/src/pages/student/StudentProfile.page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useEffect, useState } from 'react';
import { Alert, Button, Container, Grid } from '@mantine/core';
import { notifications } from '@mantine/notifications';
import { IconInfoCircle } from '@tabler/icons-react';
import { useAuth } from '@/components/AuthContext';
import { HeaderNavbar } from '@/components/Navbar';
import { useApi } from '@/util/api';
import FullScreenLoader from '@/components/AuthContext/LoadingScreen';
import StudentProfilePage, { StudentProfileDetails } from '@/components/ProfileViewer';
import FullPageError from '@/components/FullPageError';
import { IconInfoCircle } from '@tabler/icons-react';

export function StudentHomePage() {
const { userData } = useAuth();
Expand All @@ -29,8 +29,8 @@ export function StudentHomePage() {
for (let i = 0; i < response.data.degrees.length; i++) {
response.data.degrees[i].gpa = parseFloat(response.data.degrees[i].gpa);
}
if (response.data['defaultResponse']) {
response.data['name'] = userData?.name;
if (response.data.defaultResponse) {
response.data.name = userData?.name;
setNewUser(true);
}
setStudentData(response.data as StudentProfileDetails);
Expand Down Expand Up @@ -117,7 +117,7 @@ export function StudentHomePage() {
setLoading(false);
setFile(null);
return showErrorSaveNotification('Could not upload resume.');
} else {
}
try {
const presignedUrl = response.data.url;
if (!presignedUrl) {
Expand All @@ -132,10 +132,9 @@ export function StudentHomePage() {
setFile(null);
return showErrorSaveNotification('Could not upload resume.');
}
}
}
if ('defaultResponse' in studentData) {
delete studentData['defaultResponse'];
delete studentData.defaultResponse;
setStudentData(studentData);
}
setLoading(true);
Expand Down Expand Up @@ -179,9 +178,15 @@ export function StudentHomePage() {
</Container>
</div>
{newUser ? (
<Container style={{marginTop: '1em'}}>
<Alert variant="light" color="green" title="Welcome to Resume Book" icon={<IconInfoCircle />}>
We've provided you with a basic profile to get started. Fill out the details and save your profile to make it visible to recruiters.
<Container style={{ marginTop: '1em' }}>
<Alert
variant="light"
color="green"
title="Welcome to Resume Book"
icon={<IconInfoCircle />}
>
We've provided you with a basic profile to get started. Fill out the details and save
your profile to make it visible to recruiters.
</Alert>
</Container>
) : null}
Expand Down

0 comments on commit 98ab689

Please sign in to comment.