mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 15:35:49 +01:00
Switch from ReactJSS to styled-components in ui-webapp
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user