mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 01:15:44 +01:00
Simplify local storage access
The caching for local storage seems way over-engineered. With this the context for the local storage is removed and the local storage is accessed directly. Pushed-by: k8s-git-ops<admin@cloudogu.com> Pushed-by: Rene Pfeuffer<rene.pfeuffer@cloudogu.com> Co-authored-by: René Pfeuffer<rene.pfeuffer@cloudogu.com>
This commit is contained in:
@@ -17,9 +17,9 @@
|
||||
import i18next from "i18next";
|
||||
import { initReactI18next } from "react-i18next";
|
||||
import { withI18next } from "storybook-addon-i18next";
|
||||
import React, {useEffect} from "react";
|
||||
import React, { useEffect } from "react";
|
||||
import withApiProvider from "./withApiProvider";
|
||||
import { withThemes } from 'storybook-addon-themes/react';
|
||||
import { withThemes } from "storybook-addon-themes/react";
|
||||
|
||||
let i18n = i18next;
|
||||
|
||||
@@ -27,7 +27,7 @@ let i18n = i18next;
|
||||
// and not for storyshots
|
||||
if (!process.env.JEST_WORKER_ID) {
|
||||
const Backend = require("i18next-fetch-backend");
|
||||
i18n = i18n.use(Backend.default);
|
||||
i18n = i18n.use(Backend);
|
||||
}
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
@@ -58,10 +58,10 @@ export const decorators = [
|
||||
},
|
||||
}),
|
||||
withApiProvider,
|
||||
withThemes
|
||||
withThemes,
|
||||
];
|
||||
|
||||
const Decorator = ({children, themeName}) => {
|
||||
const Decorator = ({ children, themeName }) => {
|
||||
useEffect(() => {
|
||||
const link = document.querySelector("#ui-theme");
|
||||
if (link && link["data-theme"] !== themeName) {
|
||||
@@ -69,7 +69,7 @@ const Decorator = ({children, themeName}) => {
|
||||
link["data-theme"] = themeName;
|
||||
}
|
||||
}, [themeName]);
|
||||
return <>{children}</>
|
||||
return <>{children}</>;
|
||||
};
|
||||
|
||||
export const parameters = {
|
||||
|
||||
Reference in New Issue
Block a user