Skip to content

Commit fe86f31

Browse files
author
Sophie Fox
committed
Merge branch 'update-backend-routes-for-events' of https://github.com/devsoc-unsw/notangles into update-backend-routes-for-events
2 parents e6bf72a + 6ff9fc2 commit fe86f31

File tree

21 files changed

+267
-33
lines changed

21 files changed

+267
-33
lines changed

client/src/App.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,15 @@ const App: React.FC = () => {
432432

433433
useEffect(() => {
434434
updateTimetableEvents();
435+
<<<<<<< HEAD
436+
<<<<<<< HEAD
435437
}, [year, convertToLocalTimezone]);
438+
=======
439+
}, [year, isConvertToLocalTimezone]);
440+
>>>>>>> c6776d9 (Remove old account implementation (#1036))
441+
=======
442+
}, [year, convertToLocalTimezone]);
443+
>>>>>>> a3e9ad5 (Migrate settings to Tanstack Query (#1040))
436444

437445
// The following three useUpdateEffects update local storage whenever a change is made to the timetable
438446
useUpdateEffect(() => {

client/src/components/landingPage/HeroSection/HeroSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { NavigateNext } from '@mui/icons-material';
22
import { useNavigate } from 'react-router-dom';
3-
43
import notangles from '../../../assets/notangles_1.png';
54
import { useAuth } from '../../../hooks/useAuth';
65
import { FlipWords } from '../flip-words';
6+
import { useAuth } from '../../../hooks/useAuth';
77

88
const HeroSection = ({ handleStartClick }: { handleStartClick: () => void }) => {
99
const { loggedIn } = useAuth();

client/src/components/landingPage/LandingPage.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import HeroSection from './HeroSection/HeroSection';
1010
import FeaturesSection from './KeyFeaturesSection/FeaturesSection';
1111
import ScrollingFeaturesSection from './ScrollingFeaturesSection';
1212
import SponsorsSection from './SponsorsSection';
13+
import { useNavigate } from 'react-router-dom';
14+
import { API_URL } from '../../api/config';
1315

1416
const LandingPage = () => {
1517
const [authModalOpen, setAuthModalOpen] = useState(false);
@@ -30,11 +32,15 @@ const LandingPage = () => {
3032
</div>
3133
</header>
3234
<div className="snap-center h-screen">
35+
<<<<<<< HEAD
3336
<HeroSection
3437
handleStartClick={() => {
3538
setAuthModalOpen(true);
3639
}}
3740
/>
41+
=======
42+
<HeroSection handleStartClick={() => setAuthModalOpen(true)} />
43+
>>>>>>> 5f38135 (Add authentication guard and login modal (#1039))
3844
</div>
3945
<div className="snap-center h-screen flex flex-col justify-center items-center">
4046
<div className="flex pt-20 flex-col items-around justify-around">
@@ -49,6 +55,7 @@ const LandingPage = () => {
4955
<Footer />
5056
</div>
5157
</div>
58+
<<<<<<< HEAD
5259
<AuthModal
5360
open={authModalOpen}
5461
onClose={() => {
@@ -57,6 +64,9 @@ const LandingPage = () => {
5764
loading={loading}
5865
onSignIn={onSignIn}
5966
/>
67+
=======
68+
<AuthModal open={authModalOpen} onClose={() => setAuthModalOpen(false)} loading={loading} onSignIn={onSignIn} />
69+
>>>>>>> 5f38135 (Add authentication guard and login modal (#1039))
6070
</>
6171
);
6272
};

client/src/components/login/AuthGuard.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Navigate } from 'react-router-dom';
2-
32
import { useAuth } from '../../hooks/useAuth';
43
import PageLoading from '../pageLoading/PageLoading';
54

client/src/components/login/AuthModal.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export default function LoginDialog({ open, onClose, onSignIn, loading = false }
9090
Sign in to continue
9191
</Typography>
9292

93+
<<<<<<< HEAD
9394
<Button
9495
fullWidth
9596
startIcon={<AccountCircleIcon />}
@@ -133,6 +134,21 @@ export default function LoginDialog({ open, onClose, onSignIn, loading = false }
133134
}}
134135
disabled
135136
>
137+
=======
138+
<Button fullWidth startIcon={<AccountCircleIcon />} onClick={() => onSignIn('devsoc')} sx={{ mb: 2 }}>
139+
Sign in with zID
140+
</Button>
141+
142+
<Button fullWidth startIcon={<GoogleIcon />} onClick={() => onSignIn('google')} sx={{ mb: 2 }} disabled>
143+
Sign in with Google
144+
</Button>
145+
146+
<Button fullWidth startIcon={<GitHubIcon />} onClick={() => onSignIn('github')} sx={{ mb: 2 }} disabled>
147+
Sign in with GitHub
148+
</Button>
149+
150+
<Button fullWidth variant="outlined" onClick={() => onSignIn('guest')} disabled>
151+
>>>>>>> 5f38135 (Add authentication guard and login modal (#1039))
136152
Continue as Guest
137153
</Button>
138154
</>

client/src/components/sidebar/UserAccount.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { LoginRounded, LogoutRounded } from '@mui/icons-material';
22
import { Button, IconButton, Tooltip } from '@mui/material';
33
import { styled } from '@mui/material/styles';
44
import React, { useState } from 'react';
5+
<<<<<<< HEAD
56

7+
=======
8+
>>>>>>> c6776d9 (Remove old account implementation (#1036))
69
import { API_URL } from '../../api/config';
710
import storage from '../../utils/storage';
811
import { createDefaultTimetable } from '../../utils/timetableHelpers';

client/src/components/sidebar/friends/FriendsDialog.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { Close as CloseIcon } from '@mui/icons-material';
33
import { Badge, Dialog, DialogTitle, IconButton, Paper, styled, Typography } from '@mui/material';
44
import React, { useState } from 'react';
55

6+
<<<<<<< HEAD
7+
=======
8+
import { User } from './User';
9+
>>>>>>> c6776d9 (Remove old account implementation (#1036))
610
import FriendsTablist from './FriendsTablist';
711
import { User } from './User';
812

client/src/components/sidebar/friends/FriendsTablist.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import Tab from '@mui/material/Tab';
55
import Tabs from '@mui/material/Tabs';
66
import * as React from 'react';
77

8+
<<<<<<< HEAD
9+
=======
10+
import { User } from './User';
11+
>>>>>>> c6776d9 (Remove old account implementation (#1036))
812
import AddAFriendTab from './AddAFriendTab';
913
import RequestsTab from './RequestsTab';
1014
import { User } from './User';

client/src/components/sidebar/friends/YourFriendsTab.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ import React from 'react';
55

66
import { API_URL } from '../../../api/config';
77
import NetworkError from '../../../interfaces/NetworkError';
8+
<<<<<<< HEAD
89
import { User } from './User';
10+
=======
11+
>>>>>>> c6776d9 (Remove old account implementation (#1036))
912
import UserProfile from './UserProfile';
13+
import { User } from './User';
1014

1115
const StyledContainer = styled('div')`
1216
display: flex;

client/src/hooks/useAuth.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,26 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
2323
});
2424

2525
useEffect(() => {
26+
<<<<<<< HEAD
27+
<<<<<<< HEAD
28+
=======
29+
>>>>>>> a3e9ad5 (Migrate settings to Tanstack Query (#1040))
2630
getUserProfile()
2731
.then((data) => {
2832
setState({ loading: false, loggedIn: true, user: data });
2933
})
3034
.catch(() => {
3135
setState({ loading: false, loggedIn: false, user: null });
3236
});
37+
=======
38+
fetch(`${API_URL.server}/user/profile`, { credentials: 'include' })
39+
.then((res) => {
40+
if (!res.ok) throw new Error('not logged in');
41+
return res.json();
42+
})
43+
.then((data) => setState({ loading: false, loggedIn: true, user: data }))
44+
.catch(() => setState({ loading: false, loggedIn: false, user: null }));
45+
>>>>>>> 5f38135 (Add authentication guard and login modal (#1039))
3346
}, []);
3447

3548
return <AuthContext.Provider value={state}>{children}</AuthContext.Provider>;

0 commit comments

Comments
 (0)