aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorPhilippe Perrin <philippe.perrin@sonarsource.com>2020-08-06 18:45:18 +0200
committersonartech <sonartech@sonarsource.com>2020-08-11 20:06:01 +0000
commitc23296a956a8f44bc03d3865fb43d723c01a3833 (patch)
tree438f6b0189f5870020a04e6f60512a5f447f30f8 /server
parent589fd91ebc75483e2a5c092812090a548442fcde (diff)
downloadsonarqube-c23296a956a8f44bc03d3865fb43d723c01a3833.tar.gz
sonarqube-c23296a956a8f44bc03d3865fb43d723c01a3833.zip
SONAR-13617 Copy button should be centered in code snippet component
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/components/common/CodeSnippet.css6
-rw-r--r--server/sonar-web/src/main/js/components/common/CodeSnippet.tsx5
-rw-r--r--server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/CodeSnippet-test.tsx.snap2
3 files changed, 3 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/components/common/CodeSnippet.css b/server/sonar-web/src/main/js/components/common/CodeSnippet.css
index 9902360188c..aa439e2d93a 100644
--- a/server/sonar-web/src/main/js/components/common/CodeSnippet.css
+++ b/server/sonar-web/src/main/js/components/common/CodeSnippet.css
@@ -30,7 +30,7 @@
}
.code-snippet > button {
- height: 36px;
+ height: auto;
border: 0;
border-radius: 0;
background: transparent;
@@ -43,7 +43,3 @@
background-color: var(--transparentGray);
color: var(--darkBlue);
}
-
-.code-snippet-oneline > button {
- height: auto;
-}
diff --git a/server/sonar-web/src/main/js/components/common/CodeSnippet.tsx b/server/sonar-web/src/main/js/components/common/CodeSnippet.tsx
index f8dd4eb8d94..24a3bfa610d 100644
--- a/server/sonar-web/src/main/js/components/common/CodeSnippet.tsx
+++ b/server/sonar-web/src/main/js/components/common/CodeSnippet.tsx
@@ -41,10 +41,7 @@ export default function CodeSnippet(props: CodeSnippetProps) {
}
return (
- <div
- className={classNames('code-snippet spacer-top spacer-bottom display-flex-row', {
- 'code-snippet-oneline': isOneLine
- })}>
+ <div className={classNames('code-snippet spacer-top spacer-bottom display-flex-row', {})}>
<pre className="flex-1" ref={snippetRef}>
{finalSnippet}
</pre>
diff --git a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/CodeSnippet-test.tsx.snap b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/CodeSnippet-test.tsx.snap
index 2d1100b23f5..f1901c905d0 100644
--- a/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/CodeSnippet-test.tsx.snap
+++ b/server/sonar-web/src/main/js/components/common/__tests__/__snapshots__/CodeSnippet-test.tsx.snap
@@ -49,7 +49,7 @@ bar
exports[`renders correctly: single line with array snippet 1`] = `
<div
- className="code-snippet spacer-top spacer-bottom display-flex-row code-snippet-oneline"
+ className="code-snippet spacer-top spacer-bottom display-flex-row"
>
<pre
className="flex-1"