Fix docs link, test fixing relative URLs in Windows (#606)

* Fix #593: don't prevent default on link click

* Use absolute/explicit path for settings
Trying to test fix for #594

* Broken: replace almost all relative URLs with absolute

* add relative jump backs util

* dot dot slash everywhere

* use usLocation not window.location

* the one that got away

* fmt 🤦‍♂️

---------

Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
This commit is contained in:
Frank Noirot
2023-09-18 23:55:14 -04:00
committed by GitHub
parent 8147f5f1eb
commit 488e41ac0e
19 changed files with 117 additions and 65 deletions

View File

@ -23,12 +23,14 @@ import {
cameraMouseDragGuards,
} from 'lib/cameraControls'
import { UnitSystem } from 'machines/settingsMachine'
import { useDotDotSlash } from 'hooks/useDotDotSlash'
export const Settings = () => {
const loaderData = useRouteLoaderData(paths.FILE) as IndexLoaderData
const navigate = useNavigate()
const location = useLocation()
useHotkeys('esc', () => navigate('../'))
const dotDotSlash = useDotDotSlash()
useHotkeys('esc', () => navigate(dotDotSlash()))
const {
settings: {
send,
@ -66,7 +68,7 @@ export const Settings = () => {
<AppHeader showToolbar={false} project={loaderData?.project}>
<ActionButton
Element="link"
to={'../'}
to={location.pathname.replace(paths.SETTINGS, '')}
icon={{
icon: faXmark,
bgClassName: 'bg-destroy-80',
@ -267,7 +269,7 @@ export const Settings = () => {
type: 'Set Onboarding Status',
data: { onboardingStatus: '' },
})
navigate('..' + paths.ONBOARDING.INDEX)
navigate(dotDotSlash(1) + paths.ONBOARDING.INDEX)
}}
icon={{ icon: faArrowRotateBack }}
>