Add copy button to codeblocks

This commit is contained in:
Eduard Heimbuch
2023-01-25 15:55:00 +01:00
parent d74db7be2c
commit dc60c924ed
13 changed files with 460 additions and 133 deletions

View File

@@ -24,7 +24,7 @@
import React from "react";
import { withTranslation, WithTranslation } from "react-i18next";
import { Repository } from "@scm-manager/ui-types";
import { repositories, SubSubtitle } from "@scm-manager/ui-components";
import { PreformattedCodeBlock, repositories, SubSubtitle } from "@scm-manager/ui-components";
type Props = WithTranslation & {
repository: Repository;
@@ -37,12 +37,13 @@ class ProtocolInformation extends React.Component<Props> {
if (!href) {
return null;
}
const svnCheckoutCommand = `svn checkout ${href}`;
return (
<div className="content">
<SubSubtitle>{t("scm-svn-plugin.information.checkout")}</SubSubtitle>
<pre>
<code>svn checkout {href}</code>
</pre>
<PreformattedCodeBlock>{svnCheckoutCommand}</PreformattedCodeBlock>
</div>
);
}