scm-ui: new repository layout

This commit is contained in:
Sebastian Sdorra
2019-10-07 10:57:09 +02:00
parent 09c7def874
commit c05798e254
417 changed files with 3620 additions and 52971 deletions

View File

@@ -0,0 +1,57 @@
// @flow
import React from "react";
import { translate } from "react-i18next";
import { ButtonAddons, Button } from "@scm-manager/ui-components";
type Props = {
t: string => string,
historyIsSelected: boolean,
showHistory: boolean => void
};
class FileButtonGroup extends React.Component<Props> {
showHistory = () => {
this.props.showHistory(true);
};
showSources = () => {
this.props.showHistory(false);
};
color = (selected: boolean) => {
return selected ? "link is-selected" : null;
};
render() {
const { t, historyIsSelected } = this.props;
return (
<ButtonAddons>
<div title={t("sources.content.sourcesButton")}>
<Button
action={this.showSources}
className="reduced"
color={this.color(!historyIsSelected)}
>
<span className="icon">
<i className="fas fa-code" />
</span>
</Button>
</div>
<div title={t("sources.content.historyButton")}>
<Button
action={this.showHistory}
className="reduced"
color={this.color(historyIsSelected)}
>
<span className="icon">
<i className="fas fa-history" />
</span>
</Button>
</div>
</ButtonAddons>
);
}
}
export default translate("repos")(FileButtonGroup);