-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "feat: Pesist
FlowEditor
state on route changes"" (#…
- Loading branch information
1 parent
5175bbf
commit 4178422
Showing
13 changed files
with
192 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Box from "@mui/material/Box"; | ||
import LinearProgress from "@mui/material/LinearProgress"; | ||
import { styled } from "@mui/material/styles"; | ||
import React, { useEffect, useState } from "react"; | ||
import { useLoadingRoute } from "react-navi"; | ||
|
||
const Root = styled(Box)({ | ||
width: "100%", | ||
position: "fixed", | ||
top: 0, | ||
left: 0, | ||
}); | ||
|
||
const RouteLoadingIndicator: React.FC<{ | ||
msDelayBeforeVisible?: number; | ||
}> = ({ msDelayBeforeVisible = 50 }) => { | ||
const isLoading = useLoadingRoute(); | ||
const [isVisible, setIsVisible] = useState(false); | ||
|
||
useEffect(() => { | ||
if (!isLoading) return setIsVisible(false); | ||
|
||
const timer = setTimeout(() => setIsVisible(true), msDelayBeforeVisible); | ||
return () => clearTimeout(timer); | ||
}, [isLoading, msDelayBeforeVisible]); | ||
|
||
if (!isVisible) return null; | ||
|
||
return ( | ||
<Root role="alert" aria-busy="true" aria-live="assertive"> | ||
<LinearProgress /> | ||
</Root> | ||
); | ||
}; | ||
|
||
export default RouteLoadingIndicator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
editor.planx.uk/src/pages/FlowEditor/components/Settings/DataManagerSettings.tsx
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
editor.planx.uk/src/pages/FlowEditor/components/Settings/ServiceFlags.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import ErrorFallback from "components/ErrorFallback"; | ||
import FlowEditor from "pages/FlowEditor"; | ||
import React, { PropsWithChildren } from "react"; | ||
import { ErrorBoundary } from "react-error-boundary"; | ||
|
||
const FlowEditorLayout: React.FC<PropsWithChildren> = ({ children }) => ( | ||
<ErrorBoundary FallbackComponent={ErrorFallback}>{children}</ErrorBoundary> | ||
<ErrorBoundary FallbackComponent={ErrorFallback}> | ||
<FlowEditor /> | ||
{children} | ||
</ErrorBoundary> | ||
); | ||
|
||
export default FlowEditorLayout; |
Oops, something went wrong.