Skip to content

Commit

Permalink
Merge branch 'main' into 771-refactor-import
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinWu098 committed Jan 24, 2024
2 parents 0b7de7c + 53d364f commit ff9fbaf
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 19 deletions.
10 changes: 5 additions & 5 deletions apps/antalmanac/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<meta name="theme-color" content="#000000" />
<meta
name="keywords"
content="UCI,Anteater,search,classes,Calendar,development,software,add courses, antalmanac"
content="UCI,Anteater,search,classes,Calendar,development,software,add courses,antalmanac,course,course planner"
/>
<meta name="description" content="A schedule planning and time management tool for UCI students. " />
<meta name="description" content="A schedule planning and course exploration tool for UCI students. " />

<!-- Opengraph/Facebook Meta Tags -->
<meta property="og:url" content="https://antalmanac.com/" />
<meta property="og:type" content="website" />
<meta property="og:title" content="AntAlmanac" />
<meta property="og:description" content="A schedule planning and time management tool for UCI students. " />
<meta property="og:description" content="A schedule planning and course exploration tool for UCI students. " />
<meta property="og:image" content="https://antalmanac.com/logo.png" />

<!-- Twitter Meta Tags-->
Expand All @@ -40,7 +40,7 @@
<meta property="twitter:title" content="AntAlmanac" />
<meta
property="twitter:description"
content="A schedule planning and time management tool for UCI students. "
content="A schedule planning and course exploration tool for UCI students. "
/>
<meta property="twitter:image" content="https://antalmanac.com/logo.png" />

Expand Down Expand Up @@ -68,7 +68,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>AntAlmanac UCI Schedule Planner</title>
<title>AntAlmanac - UCI Schedule Planner</title>
<!-- Global site tag (gtag.js) - Google Analytics -->

<!-- console.log for recruitment -->
Expand Down
8 changes: 4 additions & 4 deletions apps/antalmanac/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
<meta name="theme-color" content="#000000" />
<meta
name="keywords"
content="UCI,Anteater,search,classes,Calendar,development,software,add courses, antalmanac"
content="UCI,Anteater,search,classes,Calendar,development,software,add courses,antalmanac,course,course planner"
/>
<meta name="description" content="A schedule planning and time management tool for UCI students. " />
<meta name="description" content="A schedule planning and course exploration tool for UCI students. " />

<!-- Opengraph/Facebook Meta Tags -->
<meta property="og:url" content="https://antalmanac.com/" />
<meta property="og:type" content="website" />
<meta property="og:title" content="AntAlmanac" />
<meta property="og:description" content="A schedule planning and time management tool for UCI students. " />
<meta property="og:description" content="A schedule planning and course exploration tool for UCI students. " />
<meta property="og:image" content="https://antalmanac.com/logo.png" />

<!-- Twitter Meta Tags-->
Expand All @@ -40,7 +40,7 @@
<meta property="twitter:title" content="AntAlmanac" />
<meta
property="twitter:description"
content="A schedule planning and time management tool for UCI students. "
content="A schedule planning and course exploration tool for UCI students. "
/>
<meta property="twitter:image" content="https://antalmanac.com/logo.png" />

Expand Down
6 changes: 2 additions & 4 deletions apps/antalmanac/src/components/Calendar/CalendarRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const AntAlmanacEvent = ({ event }: { event: CalendarEvent }) => {
{event.showLocationInfo
? event.locations.map((location) => `${location.building} ${location.room}`).join(', ')
: event.locations.length > 1
? `${event.locations.length} Locations`
: `${event.locations[0].building} ${event.locations[0].room}`}
? `${event.locations.length} Locations`
: `${event.locations[0].building} ${event.locations[0].room}`}
</Box>
<Box>{event.sectionCode}</Box>
</Box>
Expand Down Expand Up @@ -164,8 +164,6 @@ export default function ScheduleCalendar(props: ScheduleCalendarProps) {
setCurrentScheduleIndex(AppStore.getCurrentScheduleIndex());
setEventsInCalendar(AppStore.getEventsInCalendar());
setFinalEventsInCalendar(AppStore.getFinalEventsInCalendar());

handleClosePopover();
};

const updateScheduleNames = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@ class LoadSaveButtonBase extends PureComponent<LoadSaveButtonBaseProps, LoadSave
<DialogTitle>{this.props.actionName}</DialogTitle>
<DialogContent>
<DialogContentText>
Enter your username here to {this.props.actionName.toLowerCase()} your schedule.
Enter your unique user ID here to {this.props.actionName.toLowerCase()} your schedule.
</DialogContentText>
<DialogContentText style={{ color: 'red' }}>
Make sure the user ID is unique and secret, or someone else can overwrite your schedule.
</DialogContentText>
<TextField
// eslint-disable-next-line jsx-a11y/no-autofocus
autoFocus
margin="dense"
label="User ID"
label="Unique User ID"
type="text"
fullWidth
placeholder="Enter here"
Expand Down
23 changes: 19 additions & 4 deletions apps/antalmanac/src/components/Map/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default function CourseMap() {
const [searchParams] = useSearchParams();
const [selectedDayIndex, setSelectedDay] = useState(0);
const [markers, setMarkers] = useState(getCoursesPerBuilding());
const [customEventMarkers] = useState(getCustomEventPerBuilding());
const [customEventMarkers, setCustomEventMarkers] = useState(getCustomEventPerBuilding());
const [calendarEvents, setCalendarEvents] = useState(AppStore.getCourseEventsInCalendar());

useEffect(() => {
Expand Down Expand Up @@ -181,6 +181,20 @@ export default function CourseMap() {
};
}, []);

useEffect(() => {
const updateCustomEventMarkers = () => {
setCustomEventMarkers(getCustomEventPerBuilding());
};

AppStore.on('customEventsChange', updateCustomEventMarkers);
AppStore.on('currentScheduleIndexChange', updateCustomEventMarkers);

return () => {
AppStore.removeListener('customEventsChange', updateCustomEventMarkers);
AppStore.removeListener('currentScheduleIndexChange', updateCustomEventMarkers);
};
}, []);

useEffect(() => {
const locationID = Number(searchParams.get('location') ?? 0);
const building = locationID in buildingCatalogue ? buildingCatalogue[locationID] : undefined;
Expand Down Expand Up @@ -274,14 +288,15 @@ export default function CourseMap() {
* Every two markers grouped as [start, destination] tuples for the routes.
*/
const startDestPairs = useMemo(() => {
return markersToDisplay.reduce((acc, cur, index) => {
const allEvents = [...markersToDisplay, ...customEventMarkersToDisplay];
return allEvents.reduce((acc, cur, index) => {
acc.push([cur]);
if (index > 0) {
acc[index - 1].push(cur);
}
return acc;
}, [] as (typeof markersToDisplay)[]);
}, [markersToDisplay]);
}, [] as (typeof allEvents)[]);
}, [markersToDisplay, customEventMarkersToDisplay]);

return (
<Box sx={{ width: '100%', display: 'flex', flexDirection: 'column', flexGrow: 1, height: '100%' }}>
Expand Down

0 comments on commit ff9fbaf

Please sign in to comment.