diff --git a/package.json b/package.json index 92c73493..6248abe7 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", "@fortawesome/react-fontawesome": "^0.2.0", + "@reactour/tour": "^3.6.1", "@sentry/react": "^6.12.0", "@sentry/tracing": "^6.12.0", "@types/lodash": "^4.14.192", diff --git a/src/components/App/index.tsx b/src/components/App/index.tsx index 415a9a76..43d0a6eb 100644 --- a/src/components/App/index.tsx +++ b/src/components/App/index.tsx @@ -16,6 +16,7 @@ import useThemeFromStorage from '../../data/hooks/useThemeFromStorage'; import { DESKTOP_BREAKPOINT } from '../../constants'; import useScreenWidth from '../../hooks/useScreenWidth'; import InformationModal from '../InformationModal'; +import TourProvider from '../Tour'; import 'react-virtualized/styles.css'; import './stylesheet.scss'; @@ -31,50 +32,54 @@ export default function App(): React.ReactElement { return ( - - {/* To bring the website down for maintenance purposes, + + + {/* To bring the website down for maintenance purposes, insert here and disable everything below. See https://github.com/gt-scheduler/website/pull/194 for reference. */} - ( - - - - - } - > -
- There was en error somewhere in the core application logic - and it can't continue. -
-
- Try refreshing the page to see if it fixes the issue. -
-
-
-
- )} - > - - {/* AppDataLoader is in charge of ensuring that there are valid values + ( + + + + + } + > +
+ There was en error somewhere in the core application + logic and it can't continue. +
+
+ Try refreshing the page to see if it fixes the issue. +
+
+
+
+ )} + > + + {/* AppDataLoader is in charge of ensuring that there are valid values for the Terms and Term contexts before rendering its children. If any data is still loading, then it displays an "app skeleton" with a spinner. If there was an error while loading then it displays an error screen. */} - - - - - - - {/* Display a popup when first visiting the site */} - {/* Include or here */} - -
-
+ + + + + + {/* Display a popup when first visiting the site */} + {/* Include or here */} + + +
+
); diff --git a/src/components/Feedback/stylesheet.scss b/src/components/Feedback/stylesheet.scss index 18c1a17c..4a0acb89 100644 --- a/src/components/Feedback/stylesheet.scss +++ b/src/components/Feedback/stylesheet.scss @@ -6,7 +6,7 @@ border-radius: 5px; position: absolute; bottom: 24px; - right: 24px; + right: 100px; width: 60px; height: 60px; @@ -46,6 +46,7 @@ min-height: 350px; display: flex; flex-direction: column; + z-index: 1; @include popup; @extend %common; diff --git a/src/components/Tour/index.tsx b/src/components/Tour/index.tsx new file mode 100644 index 00000000..f965bbc8 --- /dev/null +++ b/src/components/Tour/index.tsx @@ -0,0 +1,189 @@ +import { + StepType, + ProviderProps, + PopoverContentProps, + useTour, + TourProvider as TourProv, +} from '@reactour/tour'; +import React from 'react'; + +import './stylesheet.scss'; + +const steps: StepType[] = [ + { + selector: '#Recurring\\ Events', + content: () => ( +
+

Add recurring events

+

+ Use{' '} + + Recurring Events + {' '} + to block out meetings, work shifts, and any other weekly events you + may need to schedule your classes around. +
+
+ Drag and drop events on the schedule view to adjust times. +

+
+ ), + }, + { + selector: '#Finals', + content: () => ( +
+

View Finals Matrix

+

+ Use the{' '} + + Finals Tab + {' '} + to view the final exam matrix. +
+
+ The final exam matrix for Fall 2023{' '} + + may not be fully finalized yet. + +

+
+ ), + }, + { + selector: '.invite-button', + highlightedSelectors: ['.invite-button', '.comparison-header'], + content: () => ( +
+

Share + Compare Schedule

+

+ Use{' '} + + Share Schedule + {' '} + to share your schedule with other students and they can share theirs + back.
+
+ Then, toggle{' '} + + Compare Schedule + {' '} + and click on the other students`'` schedules to compare. +

+
+ ), + }, + { + selector: '.tour-button', + content: () => ( +
+

User Guide

+

+ Use the{' '} + + User Guide + {' '} + at any time to review the different features of GT Scheduler. +

+
+ ), + }, +]; + +type CloseProps = { onClick?: (() => void) | undefined }; + +function Close({ onClick }: CloseProps): React.ReactElement { + return ( + + ); +} + +function nextButton(props: { + setCurrentStep: ProviderProps['setCurrentStep']; + currentStep: ProviderProps['currentStep']; + steps?: ProviderProps['steps']; + setIsOpen: PopoverContentProps['setIsOpen']; +}): React.ReactElement { + return ( + + ); +} + +function Tour(): React.ReactElement { + const { setIsOpen, setCurrentStep } = useTour(); + return ( +
+ +
+ ); +} + +type TourProviderProps = { + children: React.ReactNode; +}; + +export default function TourProvider({ + children, +}: TourProviderProps): React.ReactElement { + return ( +

} + styles={{ + popover: (base) => ({ + ...base, + borderRadius: '10px', + backgroundColor: '#333333', + padding: '30px', + }), + }} + > + {children} + + + ); +} diff --git a/src/components/Tour/stylesheet.scss b/src/components/Tour/stylesheet.scss new file mode 100644 index 00000000..9f43f7a7 --- /dev/null +++ b/src/components/Tour/stylesheet.scss @@ -0,0 +1,59 @@ +@import '../../variables'; + +.tour-button-wrapper { + @include popup; +} + +.tour-button { + width: 60px; + height: 60px; + border-radius: 1000px; + position: absolute; + bottom: 24px; + right: 24px; + width: 50px; + height: 50px; + border: none; + color: var(--theme-fg); + background-color: $color-neutral; + font-size: 30px; + font-weight: 600; + + &:hover { + cursor: pointer; + } +} + +.tour-header { + color: var(--theme-fg); + font-size: 20px; + margin: 0px; +} + +.tour-content { + color: var(--theme-fg); + font-size: 14px; +} + +.skip-tour-button { + border: none; + background-color: transparent; + color: $color-neutral; + text-decoration: underline; + + &:hover { + cursor: pointer; + } +} + +.tour-next-button { + color: white; + background-color: #c56e5b; + border-radius: 6px; + border: none; + padding: 5px 20px; + + &:hover { + cursor: pointer; + } +} diff --git a/yarn.lock b/yarn.lock index e6df0392..1c56c952 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2071,6 +2071,37 @@ resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== +"@reactour/mask@*": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@reactour/mask/-/mask-1.1.0.tgz#e327306585ee3510e80169a7fa811e9d0b9448bb" + integrity sha512-GkJMLuTs3vTsm4Ryq2uXcE4sMzRP1p4xSd6juSOMqbHa7IVD/UiLCLqJWHR9xGSQPbYhpZAZAORUG5cS0U5tBA== + dependencies: + "@reactour/utils" "*" + +"@reactour/popover@*": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@reactour/popover/-/popover-1.1.1.tgz#c9b05ee31b8677d874f1479d724204b936e1128f" + integrity sha512-BouulO0sXfmuHSPX8FwCYI0fMeT+VsWqk7UTao3NQcUC5H903ZeKOV2GYpwSJtRUQhsyNEu1Q8cEruGRf1SOXQ== + dependencies: + "@reactour/utils" "*" + +"@reactour/tour@^3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@reactour/tour/-/tour-3.6.1.tgz#7537c8faa48546fe4e312f125113459b7a19fa13" + integrity sha512-vzmgbm4T7n5gh0cjc4Zi4G3K29dXQyEdi/o7ZYLpNcisJ0hwP5jNKH7BgckrHWEGldBxYSWl34tsRmHcyxporQ== + dependencies: + "@reactour/mask" "*" + "@reactour/popover" "*" + "@reactour/utils" "*" + +"@reactour/utils@*": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@reactour/utils/-/utils-0.5.0.tgz#8886872d78839187fd53399834a1b9688e98d754" + integrity sha512-yQs5Nm/Dg1xRM7d/S/UILBV5OInrTgrjGzgc81/RP5khqdO5KnpOaC46yF83kDtCalte8X3RCwp+F2YA509k1w== + dependencies: + "@rooks/use-mutation-observer" "^4.11.2" + resize-observer-polyfill "^1.5.1" + "@remix-run/router@1.10.0": version "1.10.0" resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.10.0.tgz#e2170dc2049b06e65bbe883adad0e8ddf8291278" @@ -2120,6 +2151,11 @@ estree-walker "^1.0.1" picomatch "^2.2.2" +"@rooks/use-mutation-observer@^4.11.2": + version "4.11.2" + resolved "https://registry.yarnpkg.com/@rooks/use-mutation-observer/-/use-mutation-observer-4.11.2.tgz#a0466c4338e0a4487ea19253c86bcd427c29f4af" + integrity sha512-vpsdrZdr6TkB1zZJcHx+fR1YC/pHs2BaqcuYiEGjBVbwY5xcC49+h0hAUtQKHth3oJqXfIX/Ng8S7s5HFHdM/A== + "@rushstack/eslint-patch@^1.1.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.2.0.tgz#8be36a1f66f3265389e90b5f9c9962146758f728" @@ -10065,6 +10101,11 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== +resize-observer-polyfill@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz#0e9020dd3d21024458d4ebd27e23e40269810464" + integrity sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d"