Replace styled-components with bulma helpers (#1783)

Use Bulma helpers whenever possible instead of custom styled components.
This pull request replaces primarily color definitions, spacing and flex instructions.
This commit is contained in:
Florian Scholdei
2021-09-15 17:40:08 +02:00
committed by GitHub
parent 8a65660278
commit 2cb006d040
97 changed files with 1931 additions and 2244 deletions

View File

@@ -27,18 +27,14 @@ import { Repository, Link } from "@scm-manager/ui-types";
import { ButtonAddons, Button } from "@scm-manager/ui-components";
import CloneInformation from "./CloneInformation";
const Wrapper = styled.div`
position: relative;
`;
const Switcher = styled(ButtonAddons)`
position: absolute;
top: 0;
right: 0;
`;
const SmallButton = styled(Button).attrs(props => ({
className: "is-small"
const SmallButton = styled(Button).attrs((props) => ({
className: "is-small",
}))`
height: inherit;
`;
@@ -70,13 +66,13 @@ export default class ProtocolInformation extends React.Component<Props, State> {
constructor(props: Props) {
super(props);
this.state = {
selected: selectHttpOrFirst(props.repository)
selected: selectHttpOrFirst(props.repository),
};
}
selectProtocol = (protocol: Link) => {
this.setState({
selected: protocol
selected: protocol,
});
};
@@ -116,10 +112,10 @@ export default class ProtocolInformation extends React.Component<Props, State> {
}
return (
<Wrapper>
<div className="is-relative">
<Switcher>{protocols.map(this.renderProtocolButton)}</Switcher>
{cloneInformation}
</Wrapper>
</div>
);
}
}