mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 23:15:43 +01:00
changed BranchView component to container and simplified BranchTable with new BranchRow
This commit is contained in:
25
scm-ui/src/repos/branches/components/BranchRow.js
Normal file
25
scm-ui/src/repos/branches/components/BranchRow.js
Normal file
@@ -0,0 +1,25 @@
|
||||
// @flow
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import type { Branch } from "@scm-manager/ui-types";
|
||||
|
||||
type Props = {
|
||||
baseUrl: string,
|
||||
branch: Branch
|
||||
};
|
||||
|
||||
export default class BranchRow extends React.Component<Props> {
|
||||
renderLink(to: string, label: string) {
|
||||
return <Link to={to}>{label} <span className="tag is-dark">Default</span></Link>;
|
||||
}
|
||||
|
||||
render() {
|
||||
const { baseUrl, branch } = this.props;
|
||||
const to = `${baseUrl}/${encodeURIComponent(branch.name)}/info`;
|
||||
return (
|
||||
<tr>
|
||||
<td>{this.renderLink(to, branch.name)}</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user