{"version":3,"sources":["webpack:///../node_modules/focus-visible/dist/focus-visible.js","webpack:///./src/constants/permissionsFilterMap.ts","webpack:///./images/favicon-32x32.png","webpack:///./src/volunteer/modals/volunteerModal.styles.ts","webpack:///./src/volunteer/volunteer.hooks.ts","webpack:///./src/volunteer/modals/volunteerModal.tsx","webpack:///./src/volunteer/volunteerStatusTrigger.tsx","webpack:///./src/layout.tsx"],"names":["applyFocusVisiblePolyfill","scope","hadKeyboardEvent","hadFocusVisibleRecently","hadFocusVisibleRecentlyTimeout","inputTypesWhitelist","text","search","url","tel","email","password","number","date","month","week","time","datetime","isValidFocusTarget","el","document","nodeName","classList","addFocusVisibleClass","contains","add","setAttribute","onPointerDown","e","addInitialPointerMoveListeners","addEventListener","onInitialPointerMove","target","toLowerCase","removeEventListener","metaKey","altKey","ctrlKey","activeElement","visibilityState","type","tagName","readOnly","isContentEditable","hasAttribute","window","clearTimeout","setTimeout","remove","removeAttribute","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host","DOCUMENT_NODE","documentElement","event","CustomEvent","error","createEvent","initCustomEvent","dispatchEvent","factory","NAVY","MARINES","CIV","RESERVE","DEFAULT","SERVING","NAVYANDCIV","ALL","permissionsFilterMap","nav","dashboard","career","kit","battleships","travel","healthcare","flexi","reserves","coe","careers","pay","leave","pages","features","notifications","competences","volunteerStatus","irp","announcements","feedback","module","exports","StyledForm","styled","div","StyledBlock","props","theme","spacing","StyledFormControls","useVolunteerSubmit","postVolunteerStatus","useVolunteerStatusSender","useState","postStatus","setPostStatus","onSubmit","status","a","result","VolunteerModal","isOpen","toggle","useModal","userCanClose","focusTitle","openModal","closeModal","isModalOpen","refs","vState","setVstate","handleClick","useEffect","alert","ref","dialogRef","dialogTitleRef","dialogDescriptionRef","variant","dialogCloseRef","onClick","className","label","name","value","checked","pvpExercisesFlag","onChange","currentTarget","pvpEventsFlag","pvpCeremonialFlag","VolunteerStatus","useGlobalContext","vStatus","state","toggleVolunteerModal","toggleModal","modalOpen","setState","isInitial","faviconLinks","rel","href","favicon","StyledNotificationsHeaderContentWrapper","StyledDrawer","Drawer","StyledDrawerHeader","DrawerHeader","colors","TEXT_WHITE","BACKGROUND_NAVY","StyledDrawerButtons","BACKGROUND_WHITE","CTA_GREY_HOVER","breakpoints","BREAKPOINT_NAV","StyledDrawerEdit","DIVIDER_LIGHTGREY","renderLogo","width","height","viewBox","fill","xmlns","d","Layout","children","location","navigate","title","isDashboard","resetTab","showFooter","useMyInfo","info","serviceName","useNavigation","navStatus","mainNav","showNotifications","filterMapped","setIsOpen","notificationsLoading","setNotificationsLoading","setNotifications","newNotifications","setNewNotifications","notificationsEditMode","setNotificationsEditMode","onboarding","useOnboarding","Array","isArray","length","items","hasOnboardingSetItems","sessionStorage","getItem","showOnboarding","setShowOnboarding","fetchNotifications","useNotifications","fetchNewNotifications","useNewNotifications","signOut","useContext","SignOutContext","customCloseFn","openNotifications","closeNotifications","notificationsRef","notificationsTitleRef","notificationsCloseRef","notificationsTriggerRef","dialogTriggerRef","isNotificationsOpen","MODAL_CLOSE_SPEED","openProfile","closeProfile","profileRef","profileTitleRef","profileCloseRef","profileTriggerRef","isProfileOpen","getSlotActive","slot","pathName","pathname","withPrefix","includes","setSlotActive","toggleNotificiationsEditMode","user","initials","fullName","firstName","surname","profileHref","handleOpenNotifications","useCallback","response","notificationsList","map","notification","redirects","nullifyUnspecified","checkForNewNotifications","showVolunteerModal","checkAllowed","showFeedback","handleCloseMenu","handleOpenProfile","feedbackButtonRef","useRef","useIsNativeApp","isWebApp","isNativeApp","triggerRouteChange","link","baseURL","ActionButtons","showBadge","size","rounded","open","close","slots","navItems","hasNotificiations","site","passedRef","Modal","anchor","as","color","deleteNotification","nonDeletedNotifications","filter","n","id","editMode","indexOf","focus","loading","useSetNotificationAsDeleted","useSetNotificationAsRead","logout","hysRef","showNavyLinks","currentPath","setId","sets","handleClose","setItem"],"mappings":"+EAES,WACP,aASA,SAASA,EAA0BC,GACjC,IAAIC,GAAmB,EACnBC,GAA0B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ed51cb11d7f3abda11808e2d-c1670034fc525d1f6029.js","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define(factory) : factory();\n})(this, function () {\n 'use strict';\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n var inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n\n function isValidFocusTarget(el) {\n if (el && el !== document && el.nodeName !== 'HTML' && el.nodeName !== 'BODY' && 'classList' in el && 'contains' in el.classList) {\n return true;\n }\n\n return false;\n }\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n\n\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n\n\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n\n\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n\n\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n\n\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n\n\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n\n\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (e.target.classList.contains('focus-visible') || e.target.hasAttribute('data-focus-visible-added')) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n\n\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n\n addInitialPointerMoveListeners();\n }\n }\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n\n\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n\n\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. ¯\\_(ツ)_/¯\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n } // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n\n\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n addInitialPointerMoveListeners(); // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true); // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n } // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n\n\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill; // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n});","const NAVY = ['RN']\r\nconst MARINES = ['RM']\r\nconst RFA = ['RFA']\r\nconst CIV = ['CIV']\r\nconst RESERVE = ['RES']\r\nconst DEFAULT = [...NAVY, ...MARINES, ...RESERVE]\r\nconst FULLTIME = [...NAVY, ...MARINES]\r\nconst SERVING = [...DEFAULT, ...RFA]\r\nconst NAVYANDCIV = [...DEFAULT, ...CIV]\r\nconst ALL = [...SERVING, ...CIV]\r\n\r\nexport const permissionsFilterMap = {\r\n nav: {\r\n dashboard: ALL,\r\n career: DEFAULT,\r\n 'pay-and-benefits': DEFAULT,\r\n kit: DEFAULT,\r\n 'wellbeing-and-support': NAVYANDCIV,\r\n 'learning-and-development': NAVYANDCIV,\r\n battleships: NAVYANDCIV,\r\n travel: DEFAULT,\r\n healthcare: DEFAULT,\r\n flexi: DEFAULT,\r\n reserves: RESERVE,\r\n coe: ALL,\r\n },\r\n dashboard: {\r\n careers: DEFAULT,\r\n pay: DEFAULT,\r\n leave: DEFAULT,\r\n },\r\n pages: {\r\n 'my-info': NAVYANDCIV,\r\n },\r\n features: {\r\n notifications: DEFAULT,\r\n competences: SERVING,\r\n volunteerStatus: DEFAULT,\r\n irp: DEFAULT,\r\n announcements: ALL,\r\n feedback: DEFAULT,\r\n },\r\n}\r\n","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAF1JREFUeNpiZBA3ZKAlYGKgMWCBUP9fnKO60YwSRnT0AbKdlAPk8KC5D0YtGDT5gGBiwJrGR+OA5nFAlYw9Gge0ygfEx9ZoHIzmg1EL6J2KaNG+o7kPGId86xogwACM+xAovA6YzAAAAABJRU5ErkJggg==\"","import { StyledBlock } from '@mod/components/Form/Toggle/Toggle.styles'\r\nimport styled from 'styled-components'\r\n\r\nexport const StyledForm = styled.div`\r\n ${StyledBlock} {\r\n padding: ${props => props.theme.spacing(2)};\r\n }\r\n button {\r\n max-width: 100%;\r\n }\r\n`\r\nexport const StyledFormControls = styled.div`\r\n padding: ${props => props.theme.spacing(4, 0, 0)};\r\n`\r\n","import { useVolunteerStatusSender, VolunteerStatus } from '@mod/api'\r\nimport { useState } from 'react'\r\n\r\nexport const useVolunteerSubmit = () => {\r\n const postVolunteerStatus = useVolunteerStatusSender()\r\n const [postStatus, setPostStatus] = useState('initial')\r\n\r\n const onSubmit = async (status: VolunteerStatus) => {\r\n setPostStatus('pending')\r\n\r\n const result = await postVolunteerStatus(status)\r\n setPostStatus(result ? 'ok' : 'error')\r\n }\r\n\r\n return { onSubmit, postStatus, setPostStatus }\r\n}\r\n","import React, { useEffect, useState } from 'react'\r\nimport { Modal, Dialog, DialogTitle, DialogSummary, useModal, CTA, Toggle } from '@mod/components'\r\nimport { VolunteerStatus } from '@mod/api'\r\nimport { StyledForm, StyledFormControls } from './volunteerModal.styles'\r\nimport { useVolunteerSubmit } from '../volunteer.hooks'\r\n\r\ninterface VolunteerModalProps {\r\n isOpen: boolean\r\n toggle(open: boolean): void\r\n status: VolunteerStatus\r\n}\r\n\r\nexport const VolunteerModal = ({ isOpen, toggle, status }: VolunteerModalProps) => {\r\n const { openModal, closeModal, isModalOpen, ...refs } = useModal({\r\n userCanClose: false,\r\n focusTitle: false,\r\n })\r\n\r\n const [vState, setVstate] = useState(status)\r\n const { onSubmit, postStatus, setPostStatus } = useVolunteerSubmit()\r\n\r\n const handleSubmit = () => {\r\n onSubmit(vState)\r\n }\r\n\r\n const handleClick = () => {\r\n toggle(false)\r\n window.setTimeout(() => {\r\n setPostStatus('initial')\r\n }, 500)\r\n }\r\n\r\n useEffect(() => {\r\n if (isOpen === true) {\r\n openModal()\r\n } else {\r\n closeModal()\r\n }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [isOpen])\r\n\r\n return (\r\n \r\n \r\n {postStatus === 'ok' && (\r\n <>\r\n Status updated\r\n \r\n Thank you for updating your preferences, you can change them at any time from the My\r\n Info page\r\n \r\n \r\n Continue\r\n \r\n \r\n )}\r\n\r\n {postStatus === 'error' && (\r\n <>\r\n Error\r\n \r\n There has been an error updating your status, please try again later.\r\n \r\n \r\n Continue\r\n \r\n \r\n )}\r\n {postStatus === 'initial' && (\r\n <>\r\n Update your volunteer status\r\n \r\n Updating your Volunteer Status provides an opportunity to register your interest for\r\n the activities listed below. Once registered, you may be contacted with further\r\n information and to ascertain your eligibility and availability:\r\n \r\n {vState && (\r\n \r\n {\r\n setVstate({\r\n ...vState,\r\n pvpExercisesFlag: e.currentTarget.checked,\r\n })\r\n }}\r\n />\r\n {\r\n setVstate({\r\n ...vState,\r\n pvpEventsFlag: e.currentTarget.checked,\r\n })\r\n }}\r\n />\r\n {\r\n setVstate({\r\n ...vState,\r\n pvpCeremonialFlag: e.currentTarget.checked,\r\n })\r\n }}\r\n />\r\n \r\n Submit Preferences\r\n \r\n \r\n )}\r\n \r\n )}\r\n \r\n \r\n )\r\n}\r\n","import React, { useEffect } from 'react'\r\nimport { VolunteerModal } from './modals/volunteerModal'\r\nimport { useGlobalContext } from '../context/Global.context'\r\n\r\nexport const VolunteerStatus = () => {\r\n const {\r\n status: vStatus,\r\n state: vState,\r\n toggleModal: toggleVolunteerModal,\r\n modalOpen,\r\n setState,\r\n } = useGlobalContext().volunteerStatus\r\n\r\n useEffect(() => {\r\n if (vStatus === 'ok' && vState && vState.isInitial) {\r\n toggleVolunteerModal(true)\r\n setState({\r\n ...vState,\r\n isInitial: false,\r\n })\r\n }\r\n }, [vStatus, vState, toggleVolunteerModal, setState])\r\n\r\n return vStatus === 'ok' ? (\r\n \r\n ) : null\r\n}\r\n","import 'focus-visible'\r\nimport React, { useState, useContext, useCallback, useEffect, useRef } from 'react'\r\nimport { withPrefix } from 'gatsby'\r\nimport { Helmet } from 'react-helmet-async'\r\nimport styled from 'styled-components'\r\nimport { SignOutContext } from '@mod/auth/index.lts'\r\nimport {\r\n Header,\r\n Footer,\r\n Main,\r\n Navigation,\r\n NotificationsButton,\r\n NotificationsList,\r\n Onboarding,\r\n SiteWrapper,\r\n TextLink,\r\n Typography,\r\n MobileNavLauncher,\r\n IconButton,\r\n ProfileMenu,\r\n} from '@mod/components'\r\nimport { ModifiedNotification } from '@mod/components/NotificationsList/NotificationsList.types'\r\nimport Modal, {\r\n Drawer,\r\n DrawerContent,\r\n DrawerCloseButton,\r\n DrawerHeader,\r\n useModal,\r\n} from '@mod/components/Modal'\r\nimport { nullifyUnspecified, filterMapped, checkAllowed } from '@mod/components/utils'\r\nimport { NavSlot } from '@mod/components/Navigation/Navigation.types'\r\nimport { ProfileUser } from '@mod/components/ProfileMenu/ProfileMenu.types'\r\nimport {\r\n useMyInfo,\r\n useNotifications,\r\n useNewNotifications,\r\n useSetNotificationAsRead,\r\n useSetNotificationAsDeleted,\r\n Notification,\r\n} from '@mod/api'\r\nimport { useOnboarding, APIOnboardingSets } from '@mod/features/src/Onboarding/Onboarding.context'\r\nimport { AddToHomeScreen, FeedbackLoader } from '@mod/features'\r\nimport { useNavigation } from '@mod/features/src/Navigation/Navigation.context'\r\nimport { VolunteerStatus } from './volunteer/volunteerStatusTrigger'\r\nimport { permissionsFilterMap } from './constants'\r\nimport { useGlobalContext } from './context/Global.context'\r\nimport favicon from '../images/favicon-32x32.png'\r\nimport { useIsNativeApp } from '@mod/features/src/NativeApp'\r\n\r\n// Manualy specify favicon\r\nconst faviconLinks = [{ rel: 'icon', type: 'image/png', href: favicon }]\r\n\r\nconst NOTIFICATIONS_ENABLED = true\r\n\r\nconst StyledNotificationsHeaderContentWrapper = styled.div`\r\n align-items: center;\r\n display: flex;\r\n justify-content: space-between;\r\n`\r\nconst StyledDrawer = styled(Drawer)`\r\n padding-top: 0;\r\n`\r\nconst StyledDrawerHeader = styled(DrawerHeader)`\r\n padding: ${props => props.theme.spacing(3, 4, 2, 4)};\r\n color: ${props => props.theme.colors.TEXT_WHITE};\r\n background: ${props => props.theme.colors.BACKGROUND_NAVY};\r\n`\r\n\r\nconst StyledDrawerButtons = styled.div`\r\n display: flex;\r\n justify-content: flex-end;\r\n * + * {\r\n margin-left: ${props => props.theme.spacing(1)};\r\n }\r\n\r\n button {\r\n background: ${props => props.theme.colors.BACKGROUND_WHITE};\r\n &:hover {\r\n background: ${props => props.theme.colors.CTA_GREY_HOVER};\r\n }\r\n }\r\n\r\n @media (min-width: ${props => props.theme.breakpoints.BREAKPOINT_NAV}) {\r\n .hide-desktop {\r\n display: none;\r\n }\r\n }\r\n`\r\nconst StyledDrawerEdit = styled.div`\r\n min-height: ${props => props.theme.spacing(6)};\r\n padding: 0 ${props => props.theme.spacing(2)};\r\n display: flex;\r\n justify-content: flex-end;\r\n border-bottom: 1px solid ${props => props.theme.colors.DIVIDER_LIGHTGREY};\r\n`\r\n\r\nconst renderLogo = () => (\r\n \r\n \r\n \r\n \r\n)\r\n\r\ninterface LayoutProps {\r\n title: string\r\n location: {\r\n pathname: string\r\n href: string\r\n }\r\n navigate: (to: string) => void\r\n isDashboard?: boolean\r\n resetTab?: () => void\r\n showFooter?: boolean\r\n}\r\n\r\ninterface FooterContent {\r\n quickLinks: {\r\n linkText: string\r\n linkUrl: string\r\n }[]\r\n}\r\n\r\nconst hasOnboardingSetItems = (onboarding: APIOnboardingSets) => {\r\n const hasSet = Array.isArray(onboarding) && onboarding.length > 0\r\n const hasItems = hasSet && onboarding[0].items.length > 0\r\n\r\n return hasItems\r\n}\r\n\r\nexport const Layout: React.FunctionComponent = ({\r\n children,\r\n location,\r\n navigate,\r\n title,\r\n isDashboard,\r\n resetTab,\r\n showFooter = true,\r\n}) => {\r\n const [status, info] = useMyInfo()\r\n const { serviceName } = info\r\n const [navStatus, mainNav] = useNavigation()\r\n\r\n const showNotifications = filterMapped(\r\n 'notifications',\r\n permissionsFilterMap.features,\r\n serviceName,\r\n )\r\n\r\n const [isOpen, setIsOpen] = useState(false)\r\n const [notificationsLoading, setNotificationsLoading] = useState(true)\r\n const [notifications, setNotifications] = useState(null)\r\n const [newNotifications, setNewNotifications] = useState(false)\r\n const [notificationsEditMode, setNotificationsEditMode] = useState(false)\r\n\r\n // Onboarding\r\n const [, onboarding] = useOnboarding()\r\n const [showOnboarding, setShowOnboarding] = useState(\r\n hasOnboardingSetItems(onboarding) && !sessionStorage.getItem('onboardingSeen'),\r\n )\r\n\r\n const fetchNotifications = useNotifications()\r\n const fetchNewNotifications = useNewNotifications()\r\n const signOut = useContext(SignOutContext)\r\n\r\n const {\r\n openModal: openNotifications,\r\n closeModal: closeNotifications,\r\n dialogRef: notificationsRef,\r\n dialogTitleRef: notificationsTitleRef,\r\n dialogCloseRef: notificationsCloseRef,\r\n dialogTriggerRef: notificationsTriggerRef,\r\n isModalOpen: isNotificationsOpen,\r\n MODAL_CLOSE_SPEED,\r\n } = useModal({\r\n customCloseFn: () => setNotificationsEditMode(false),\r\n })\r\n\r\n const {\r\n openModal: openProfile,\r\n closeModal: closeProfile,\r\n dialogRef: profileRef,\r\n dialogTitleRef: profileTitleRef,\r\n dialogCloseRef: profileCloseRef,\r\n dialogTriggerRef: profileTriggerRef,\r\n isModalOpen: isProfileOpen,\r\n } = useModal()\r\n\r\n const toggleIsOpen = () => setIsOpen(currentOpen => !currentOpen)\r\n\r\n const getSlotActive = (slot: NavSlot) => {\r\n if (slot.pathName === '/') {\r\n return location.pathname === withPrefix('/')\r\n }\r\n return location.pathname.includes(slot.pathName)\r\n }\r\n\r\n const setSlotActive = (slot: NavSlot) => {\r\n if (getSlotActive(slot)) {\r\n setIsOpen(false)\r\n }\r\n\r\n navigate(withPrefix(slot.pathName))\r\n }\r\n\r\n const toggleNotificiationsEditMode = () => {\r\n setNotificationsEditMode(!notificationsEditMode)\r\n }\r\n\r\n const user: ProfileUser = {\r\n initials: status === 'ok' ? info.initials : '',\r\n fullName: status === 'ok' ? `${info.firstName} ${info.surname}` : '',\r\n profileHref: filterMapped('my-info', permissionsFilterMap.pages, serviceName)\r\n ? '/my-info'\r\n : null,\r\n }\r\n\r\n const handleOpenNotifications = useCallback(async () => {\r\n setNotificationsLoading(true)\r\n openNotifications()\r\n closeProfile()\r\n\r\n try {\r\n const response = (await fetchNotifications()) || null\r\n\r\n const notificationsList = response?.map(notification => {\r\n const redirects = !!nullifyUnspecified(notification.url)\r\n\r\n return {\r\n ...notification,\r\n redirects,\r\n }\r\n })\r\n\r\n setNotifications(notificationsList)\r\n } finally {\r\n setNotificationsLoading(false)\r\n }\r\n }, [fetchNotifications])\r\n\r\n const handleClickNotifications = (notification: Notification) => {\r\n closeNotifications()\r\n\r\n if (resetTab) {\r\n resetTab()\r\n }\r\n\r\n setTimeout(() => {\r\n // If there is a url and it starts with a '/' then navigate to it\r\n if (!!nullifyUnspecified(notification.url) && notification.url.indexOf('/') === 0) {\r\n navigate(withPrefix(notification.url))\r\n return\r\n }\r\n // if there is a url and it doesn't start with a '/' then open it in a new tab\r\n if (!!nullifyUnspecified(notification.url) && typeof window !== 'undefined') {\r\n window.open(notification.url, '_blank').focus()\r\n }\r\n }, MODAL_CLOSE_SPEED)\r\n }\r\n\r\n const deleteNotification = (notification: Notification) => {\r\n const nonDeletedNotifications = notifications.filter(n => n.id !== notification.id)\r\n\r\n setNotifications(nonDeletedNotifications)\r\n }\r\n\r\n const checkForNewNotifications = useCallback(async () => {\r\n const response = await fetchNewNotifications()\r\n setNewNotifications(response || false)\r\n }, [fetchNewNotifications])\r\n\r\n useEffect(() => {\r\n if (NOTIFICATIONS_ENABLED) {\r\n checkForNewNotifications()\r\n }\r\n }, [isNotificationsOpen])\r\n\r\n const { modalOpen: volunteerModalOpen } = useGlobalContext().volunteerStatus\r\n const showVolunteerModal = checkAllowed(\r\n serviceName,\r\n permissionsFilterMap.features.volunteerStatus,\r\n )\r\n\r\n const showFeedback = checkAllowed(serviceName, permissionsFilterMap.features.feedback)\r\n\r\n const handleOpenMenu = () => {\r\n setIsOpen(true)\r\n closeNotifications()\r\n closeProfile()\r\n }\r\n\r\n const handleCloseMenu = () => {\r\n setIsOpen(false)\r\n }\r\n\r\n const handleOpenProfile = () => {\r\n closeNotifications()\r\n handleCloseMenu()\r\n openProfile()\r\n }\r\n\r\n const feedbackButtonRef = useRef(null)\r\n\r\n const { isWebApp, isNativeApp, triggerRouteChange } = useIsNativeApp()\r\n // trigger route change message\r\n useEffect(() => {\r\n if (isNativeApp) {\r\n triggerRouteChange(location.href)\r\n }\r\n }, [location])\r\n\r\n return (\r\n <>\r\n \r\n \r\n MyNavy | {title}\r\n \r\n {/* HEADER AND HAMBURGER MENU */}\r\n {isWebApp && (\r\n \r\n {NOTIFICATIONS_ENABLED && showNotifications && (\r\n \r\n )}\r\n \r\n \r\n }\r\n />\r\n )}\r\n {isWebApp && (\r\n \r\n )}\r\n {isWebApp && (\r\n setIsOpen(true)}\r\n close={() => setIsOpen(false)}\r\n slots={mainNav?.navItems}\r\n getSlotActive={getSlotActive}\r\n setSlotActive={setSlotActive}\r\n status={navStatus}\r\n />\r\n )}\r\n\r\n {/* MAIN */}\r\n
{children}
\r\n\r\n {/* FOOTER */}\r\n {showFooter && (\r\n
\r\n {showFeedback && }\r\n {isWebApp && }\r\n
\r\n )}\r\n\r\n {/* MODAL CONTENT (APPEARS ON EVERY PAGE) */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Notifications\r\n \r\n \r\n \r\n\r\n {(notifications?.length || notificationsEditMode) && (\r\n \r\n {notificationsEditMode ? (\r\n Done\r\n ) : (\r\n \r\n )}\r\n \r\n )}\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n {NOTIFICATIONS_ENABLED && showNotifications && (\r\n \r\n )}\r\n\r\n \r\n \r\n \r\n \r\n Profile\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n {showVolunteerModal && }\r\n
\r\n {showOnboarding && !!onboarding[0] && (\r\n {\r\n setShowOnboarding(false)\r\n sessionStorage.setItem('onboardingSeen', 'true')\r\n }}\r\n />\r\n )}\r\n \r\n )\r\n}\r\n"],"sourceRoot":""}