Update: add more toast notifications, update position

Also set Account page to use UserContext. Refactored api requests out of components.
This commit is contained in:
Aaron William Po
2023-05-22 22:41:37 -04:00
parent 27e72d3dcf
commit 4c30af27b6
16 changed files with 242 additions and 188 deletions

View File

@@ -18,8 +18,9 @@ import { useState, useEffect } from 'react';
*/
const useMediaQuery = (query: `(${string})`) => {
/**
* Initialize the matches state variable to false. This is updated whenever the viewport
* size changes (i.e. when the component is mounted and when the window is resized)
* Initialize the matches state variable to false. This is updated whenever the
* viewport size changes (i.e. when the component is mounted and when the window is
* resized)
*/
const [matches, setMatches] = useState(false);
@@ -34,8 +35,8 @@ const useMediaQuery = (query: `(${string})`) => {
}
/**
* Add a resize event listener to the window object, and update the `matches` state
* variable whenever the viewport size changes.
* Add a resize event listener to the window object, and update the `matches`
* state variable whenever the viewport size changes.
*/
const listener = () => setMatches(media.matches);
window.addEventListener('resize', listener);