* Use platform-agnostic path separators * Fix file settings by fixing absolute file path * Fix missing home link in AppHeader * Found so many more instances of raw "/" characters * Tiny Settings style fix * Clean up onboarding behavior for XState and multi-file
13 lines
344 B
TypeScript
13 lines
344 B
TypeScript
import { BROWSER_FILE_NAME, IndexLoaderData, paths } from 'Router'
|
|
import { useRouteLoaderData } from 'react-router-dom'
|
|
|
|
export function useAbsoluteFilePath() {
|
|
const routeData = useRouteLoaderData(paths.FILE) as IndexLoaderData
|
|
|
|
return (
|
|
paths.FILE +
|
|
'/' +
|
|
encodeURIComponent(routeData?.file?.path || BROWSER_FILE_NAME)
|
|
)
|
|
}
|