[next] Admin auth + design (#2056)

* feat: extract jwt information

* feat: login status dependent auto redirect

* feat: Sign Out button

* feat: add a 404 page

* feat: improve loading state and use auth token info

* feat: redirect to previous destination

* feat: implement new design

* fix: change asset to story

* feat: add translations

* feat: more compact design

* test: add unit tests

* chore: refactor NavigationLink

* test: add integration tests

* chore: refactor replaceHistoryLocation

* fix: typo

* fix: property name typo
This commit is contained in:
Kiwi
2018-10-31 23:11:32 +00:00
committed by Wyatt Johnson
parent 1dc400ba58
commit bc5db7b599
123 changed files with 4014 additions and 461 deletions
@@ -10,3 +10,4 @@ export {
} from "./removeFragmentRefs";
export { default as createUUIDGenerator } from "./createUUIDGenerator";
export * from "./denormalize";
export { default as replaceHistoryLocation } from "./replaceHistoryLocation";
@@ -0,0 +1,15 @@
type RestoreHistoryFunction = () => void;
export default function replaceHistoryLocation(
location: string
): RestoreHistoryFunction {
const previousState = window.history.state;
const previousLocation = location.toString();
window.history.replaceState(previousState, document.title, location);
return () =>
window.history.replaceState(
previousState,
document.title,
previousLocation
);
}