- {!sidebarCollapsed && (
+ {(!sidebarCollapsed || overrideCollapse) && (
{getFullName(firstName, lastName)}
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/components/timetable/DroppedClass.tsx b/client/src/components/timetable/DroppedClass.tsx
index 6372c1751..12315a134 100644
--- a/client/src/components/timetable/DroppedClass.tsx
+++ b/client/src/components/timetable/DroppedClass.tsx
@@ -36,6 +36,11 @@ const DroppedClass: React.FC = ({
setCopiedEvent,
copiedEvent,
}) => {
+ let readOnly = false;
+ if (location.pathname !== '/home') {
+ readOnly = true;
+ }
+
const [fullscreenVisible, setFullscreenVisible] = useState(false);
const [popupOpen, setPopupOpen] = useState(false);
const [contextMenu, setContextMenu] = useState(null);
@@ -85,6 +90,9 @@ const DroppedClass: React.FC = ({
}
const startDrag = () => {
+ if (readOnly) {
+ return;
+ }
timer = null;
setIsDrag(true);
setDragTarget(classCard, currCourse, isSquareEdges, eventCopy);
diff --git a/client/src/components/timetable/DroppedEvent.tsx b/client/src/components/timetable/DroppedEvent.tsx
index a407864d3..f7fcf469c 100644
--- a/client/src/components/timetable/DroppedEvent.tsx
+++ b/client/src/components/timetable/DroppedEvent.tsx
@@ -41,6 +41,11 @@ const DroppedEvent: React.FC = ({
setCopiedEvent,
copiedEvent,
}) => {
+ let readOnly = false;
+ if (location.pathname !== '/home') {
+ readOnly = true;
+ }
+
const [fullscreenVisible, setFullscreenVisible] = useState(false);
const [popupOpen, setPopupOpen] = useState(false);
const [contextMenu, setContextMenu] = useState(null);
@@ -84,6 +89,9 @@ const DroppedEvent: React.FC = ({
const startDrag = () => {
timer = null;
+ if (readOnly) {
+ return;
+ }
setIsDrag(true);
setDragTarget(eventPeriod, null, isSquareEdges, eventCopy, eventId);
setInfoVisibility(false);
diff --git a/client/src/components/timetable/ExpandedEventView.tsx b/client/src/components/timetable/ExpandedEventView.tsx
index 6caebe62a..663e83e5c 100644
--- a/client/src/components/timetable/ExpandedEventView.tsx
+++ b/client/src/components/timetable/ExpandedEventView.tsx
@@ -65,6 +65,10 @@ const ExpandedEventView: React.FC = ({
setIsEditing,
isEditing,
}) => {
+ if (window.location.pathname !== '/home') {
+ // return;
+ isEditing = false;
+ }
const { name, location, description, color } = eventPeriod.event;
const { day, start, end } = eventPeriod.time;
const [isChanged, setIsChanged] = useState(false);
@@ -226,9 +230,12 @@ const ExpandedEventView: React.FC = ({
};
const handleDeleteEvent = (id: string) => {
- const updatedEventData = { ...createdEvents };
- delete updatedEventData[id];
- setCreatedEvents(updatedEventData);
+ if (isEditing) {
+ const updatedEventData = { ...createdEvents };
+ delete updatedEventData[id];
+ setCreatedEvents(updatedEventData);
+ }
+
};
const handleSaveNewColor = () => {
diff --git a/client/src/components/timetable/Timetable.tsx b/client/src/components/timetable/Timetable.tsx
index bd7c719ff..9013b2137 100644
--- a/client/src/components/timetable/Timetable.tsx
+++ b/client/src/components/timetable/Timetable.tsx
@@ -10,6 +10,7 @@ import { TimetableProps } from '../../interfaces/PropTypes';
import DroppedCards from './DroppedCards';
import Dropzones from './Dropzones';
import { TimetableLayout } from './TimetableLayout';
+import { useLocation } from 'react-router';
const StyledTimetable = styled(Box, {
shouldForwardProp: (prop) => !['rows', 'cols'].includes(prop.toString()),
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"
+ />