Refactor to reuse wall of text 😂

This commit is contained in:
Sergio Padrino 2021-06-04 14:06:37 +02:00
parent 19c5752505
commit be3f38cead

View file

@ -65,11 +65,7 @@ export class WarnLocalChangesBeforeUndo extends React.Component<
some of these changes being lost.
<br />
<br />
Also, undoing a merge commit will apply the changes from the merge
into your working directory, and committing again will create an
entirely new commit. This means you will lose the merge commit and, as
a result, commits from the merged branch could disappear from this
branch.
{this.getMergeCommitUndoWarningText()}
<br />
<br />
Do you want to continue anyway?
@ -78,10 +74,7 @@ export class WarnLocalChangesBeforeUndo extends React.Component<
} else if (this.props.commit.isMergeCommit) {
return (
<>
Undoing a merge commit will apply the changes from the merge into your
working directory, and committing again will create an entirely new
commit. This means you will lose the merge commit and, as a result,
commits from the merged branch could disappear from this branch.
{this.getMergeCommitUndoWarningText()}
<br />
<br />
Do you want to continue anyway?
@ -97,6 +90,13 @@ export class WarnLocalChangesBeforeUndo extends React.Component<
}
}
private getMergeCommitUndoWarningText() {
return `Undoing a merge commit will apply the changes from the merge into
your working directory, and committing again will create an entirely new
commit. This means you will lose the merge commit and, as a result, commits
from the merged branch could disappear from this branch.`
}
private onSubmit = async () => {
const { dispatcher, repository, commit, onDismissed } = this.props
this.setState({ isLoading: true })