mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
use styled-components for scm-git-plugin instead of react-jss
This commit is contained in:
@@ -4,8 +4,8 @@ import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import * as ReactRouterDom from "react-router-dom";
|
||||
import * as ReactRedux from "react-redux";
|
||||
import {default as injectSheets } from "react-jss";
|
||||
import * as ReactJSS from "react-jss";
|
||||
import SytleComponentsDefault from "styled-components";
|
||||
import * as SytleComponents from "styled-components";
|
||||
import * as ReactI18Next from "react-i18next";
|
||||
import * as ClassNames from "classnames";
|
||||
import * as UIExtensions from "@scm-manager/ui-extensions";
|
||||
@@ -30,14 +30,23 @@ SystemJS.config({
|
||||
}
|
||||
});
|
||||
|
||||
const expose = (name, cmp) => {
|
||||
SystemJS.set(name, SystemJS.newModule(cmp));
|
||||
const expose = (name, cmp, defaultCmp) => {
|
||||
let mod = cmp;
|
||||
if (defaultCmp) {
|
||||
// SystemJS default export:
|
||||
// https://github.com/systemjs/systemjs/issues/1749
|
||||
mod = {
|
||||
...cmp,
|
||||
__useDefault: defaultCmp
|
||||
};
|
||||
}
|
||||
SystemJS.set(name, SystemJS.newModule(mod));
|
||||
};
|
||||
|
||||
expose("react", React);
|
||||
expose("react-dom", ReactDOM);
|
||||
expose("react-router-dom", ReactRouterDom);
|
||||
expose("react-jss", {...ReactJSS, default: injectSheets});
|
||||
expose("styled-components", SytleComponents, SytleComponentsDefault);
|
||||
expose("react-redux", ReactRedux);
|
||||
expose("react-i18next", ReactI18Next);
|
||||
expose("classnames", ClassNames);
|
||||
|
||||
Reference in New Issue
Block a user