Switch from ReactJSS to styled-components in ui-webapp

This commit is contained in:
Florian Scholdei
2019-10-09 16:17:02 +02:00
parent 01ef497d07
commit 004b6e5340
23 changed files with 544 additions and 675 deletions

View File

@@ -1,39 +1,30 @@
//@flow
import React from "react";
import injectSheet from "react-jss";
import { translate } from "react-i18next";
import styled from "styled-components";
import { Tag } from "@scm-manager/ui-components";
type Props = {
defaultBranch?: boolean,
// context props
classes: any,
t: string => string
};
const styles = {
tag: {
marginLeft: "0.75rem",
verticalAlign: "inherit"
}
};
const LeftMarginTag = styled(Tag)`
vertical-align: inherit;
margin-left: 0.75rem;
`;
class DefaultBranchTag extends React.Component<Props> {
render() {
const { defaultBranch, classes, t } = this.props;
const { defaultBranch, t } = this.props;
if (defaultBranch) {
return (
<Tag
className={classes.tag}
color="dark"
label={t("branch.defaultTag")}
/>
);
return <LeftMarginTag color="dark" label={t("branch.defaultTag")} />;
}
return null;
}
}
export default injectSheet(styles)(translate("repos")(DefaultBranchTag));
export default translate("repos")(DefaultBranchTag);