-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a debug tool to help clear local storage when it is incompatible …
…with the current version.
- Loading branch information
1 parent
44d1c20
commit c008eab
Showing
6 changed files
with
54 additions
and
5 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
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,11 +1,26 @@ | ||
import React from 'react'; | ||
import { ErrorBoundary } from 'react-error-boundary'; | ||
|
||
import { AvailableFormList } from '@atj/design'; | ||
import { getAppContext } from '../context'; | ||
import { getFormUrl } from '../routes'; | ||
import DebugTools from './DebugTools'; | ||
|
||
export default () => { | ||
const ctx = getAppContext(); | ||
return ( | ||
<AvailableFormList formService={ctx.formService} urlForForm={getFormUrl} /> | ||
<ErrorBoundary | ||
fallback={ | ||
<div> | ||
There was an unexpected error rendering the form list. | ||
<DebugTools /> | ||
</div> | ||
} | ||
> | ||
<AvailableFormList | ||
formService={ctx.formService} | ||
urlForForm={getFormUrl} | ||
/> | ||
</ErrorBoundary> | ||
); | ||
}; |
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,18 @@ | ||
import React from 'react'; | ||
|
||
export default function DebugTools() { | ||
return ( | ||
<section> | ||
<button | ||
className="usa-button" | ||
onClick={() => { | ||
console.log('clearing'); | ||
window.localStorage.clear(); | ||
window.location.reload(); | ||
}} | ||
> | ||
Delete all demo data (clear browser local storage) | ||
</button> | ||
</section> | ||
); | ||
} |
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,11 @@ | ||
--- | ||
import ContentLayout from '../layouts/ContentLayout.astro'; | ||
import AppAvailableFormList from '../components/AppAvailableFormList'; | ||
import DebugTools from '../components/DebugTools'; | ||
--- | ||
|
||
<ContentLayout title="10x Access to Justice Spotlight"> | ||
<h1>10x Access to Justice Spotlight</h1> | ||
<AppAvailableFormList client:only /> | ||
<DebugTools client:only /> | ||
</ContentLayout> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.