2018-09-17 14:03:13 +02:00
|
|
|
// @flow
|
|
|
|
|
import ChangesetRow from "./ChangesetRow";
|
|
|
|
|
import React from "react";
|
2019-01-29 17:12:18 +01:00
|
|
|
import injectSheet from "react-jss";
|
|
|
|
|
import classNames from "classnames";
|
2018-12-10 08:45:59 +01:00
|
|
|
|
2018-10-08 17:34:11 +02:00
|
|
|
import type { Changeset, Repository } from "@scm-manager/ui-types";
|
2018-09-17 14:03:13 +02:00
|
|
|
|
|
|
|
|
type Props = {
|
2018-09-19 16:05:35 +02:00
|
|
|
repository: Repository,
|
2019-01-29 17:12:18 +01:00
|
|
|
changesets: Changeset[],
|
|
|
|
|
classes: any
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const styles = {
|
|
|
|
|
toCenterContent: {
|
|
|
|
|
display: "block"
|
|
|
|
|
}
|
2018-09-18 16:45:22 +02:00
|
|
|
};
|
2018-09-17 14:03:13 +02:00
|
|
|
|
2018-09-19 16:19:59 +02:00
|
|
|
class ChangesetList extends React.Component<Props> {
|
2018-09-17 14:03:13 +02:00
|
|
|
render() {
|
2019-01-29 17:12:18 +01:00
|
|
|
const { repository, changesets, classes } = this.props;
|
2018-10-17 15:03:32 +02:00
|
|
|
const content = changesets.map(changeset => {
|
2018-10-08 17:34:11 +02:00
|
|
|
return (
|
|
|
|
|
<ChangesetRow
|
2018-10-17 15:03:32 +02:00
|
|
|
key={changeset.id}
|
2018-10-08 17:34:11 +02:00
|
|
|
repository={repository}
|
|
|
|
|
changeset={changeset}
|
|
|
|
|
/>
|
|
|
|
|
);
|
2018-09-18 16:45:22 +02:00
|
|
|
});
|
2019-01-29 17:12:18 +01:00
|
|
|
return (
|
|
|
|
|
<div className={classNames("panel-block", classes.toCenterContent)}>
|
|
|
|
|
{content}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2018-09-17 14:03:13 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-29 17:12:18 +01:00
|
|
|
export default injectSheet(styles)(ChangesetList);
|