mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 22:45:45 +01:00
Switch from ReactJSS to styled-components in ui-webapp
This commit is contained in:
@@ -116,7 +116,6 @@ class Sources extends React.Component<Props, State> {
|
||||
const {
|
||||
repository,
|
||||
baseUrl,
|
||||
branches,
|
||||
loading,
|
||||
error,
|
||||
revision,
|
||||
@@ -124,8 +123,6 @@ class Sources extends React.Component<Props, State> {
|
||||
currentFileIsDirectory
|
||||
} = this.props;
|
||||
|
||||
const { selectedBranch } = this.state;
|
||||
|
||||
if (error) {
|
||||
return <ErrorNotification error={error} />;
|
||||
}
|
||||
@@ -138,17 +135,7 @@ class Sources extends React.Component<Props, State> {
|
||||
return (
|
||||
<div className="panel">
|
||||
{this.renderBranchSelector()}
|
||||
<Breadcrumb
|
||||
revision={encodeURIComponent(revision)}
|
||||
path={path}
|
||||
baseUrl={baseUrl}
|
||||
branch={selectedBranch}
|
||||
defaultBranch={
|
||||
branches && branches.filter(b => b.defaultBranch === true)[0]
|
||||
}
|
||||
branches={branches && branches}
|
||||
repository={repository}
|
||||
/>
|
||||
{this.renderBreadcrumb()}
|
||||
<FileTree
|
||||
repository={repository}
|
||||
revision={revision}
|
||||
@@ -183,6 +170,28 @@ class Sources extends React.Component<Props, State> {
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
renderBreadcrumb = () => {
|
||||
const { revision, path, baseUrl, branches, repository } = this.props;
|
||||
const { selectedBranch } = this.state;
|
||||
|
||||
if (revision) {
|
||||
return (
|
||||
<Breadcrumb
|
||||
revision={encodeURIComponent(revision)}
|
||||
path={path}
|
||||
baseUrl={baseUrl}
|
||||
branch={selectedBranch}
|
||||
defaultBranch={
|
||||
branches && branches.filter(b => b.defaultBranch === true)[0]
|
||||
}
|
||||
branches={branches && branches}
|
||||
repository={repository}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
const mapStateToProps = (state, ownProps) => {
|
||||
|
||||
Reference in New Issue
Block a user