diff options
Diffstat (limited to 'opendc-web/opendc-web-ui/src/util')
| -rw-r--r-- | opendc-web/opendc-web-ui/src/util/authorizations.js | 8 | ||||
| -rw-r--r-- | opendc-web/opendc-web-ui/src/util/hooks.js | 29 | ||||
| -rw-r--r-- | opendc-web/opendc-web-ui/src/util/sidebar-space.js | 4 |
3 files changed, 7 insertions, 34 deletions
diff --git a/opendc-web/opendc-web-ui/src/util/authorizations.js b/opendc-web/opendc-web-ui/src/util/authorizations.js index 4086b35d..eb492d26 100644 --- a/opendc-web/opendc-web-ui/src/util/authorizations.js +++ b/opendc-web/opendc-web-ui/src/util/authorizations.js @@ -1,7 +1,9 @@ +import { faHome, faPencilAlt, faEye } from '@fortawesome/free-solid-svg-icons' + export const AUTH_ICON_MAP = { - OWN: 'home', - EDIT: 'pencil', - VIEW: 'eye', + OWN: faHome, + EDIT: faPencilAlt, + VIEW: faEye, } export const AUTH_DESCRIPTION_MAP = { diff --git a/opendc-web/opendc-web-ui/src/util/hooks.js b/opendc-web/opendc-web-ui/src/util/hooks.js deleted file mode 100644 index 7780a778..00000000 --- a/opendc-web/opendc-web-ui/src/util/hooks.js +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2021 AtLarge Research - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -import { useEffect } from 'react' - -export function useDocumentTitle(title) { - useEffect(() => { - document.title = title - }, [title]) -} diff --git a/opendc-web/opendc-web-ui/src/util/sidebar-space.js b/opendc-web/opendc-web-ui/src/util/sidebar-space.js index ef09d40a..005c40f3 100644 --- a/opendc-web/opendc-web-ui/src/util/sidebar-space.js +++ b/opendc-web/opendc-web-ui/src/util/sidebar-space.js @@ -1,2 +1,2 @@ -export const isCollapsible = (location) => - location.pathname.indexOf('portfolios') === -1 && location.pathname.indexOf('scenarios') === -1 +export const isCollapsible = (router) => + router.asPath.indexOf('portfolios') === -1 && router.asPath.indexOf('scenarios') === -1 |
