- |
+ |
'Starts' tab matches snapshot 1`] = `
|
|
-
+ |
preview", () => {
it("renders PayloadPreview after clicking the toggle", () => {
const tree = MountedSilenceForm();
- tree.find("span.btn.cursor-pointer.text-muted").simulate("click");
+ tree.find("span.badge.cursor-pointer.text-muted").simulate("click");
expect(tree.find("PayloadPreview")).toHaveLength(1);
});
it("clicking on the toggle icon toggles PayloadPreview", () => {
const tree = MountedSilenceForm();
- const button = tree.find(".btn.cursor-pointer.text-muted");
+ const button = tree.find(".badge.cursor-pointer.text-muted");
expect(tree.find("PayloadPreview")).toHaveLength(0);
button.simulate("click");
expect(tree.find("PayloadPreview")).toHaveLength(1);
@@ -263,7 +263,7 @@ describe(" preview", () => {
silenceFormStore.data.autofillMatchers = false;
const tree = MountedSilenceForm();
- tree.find(".btn.cursor-pointer.text-muted").simulate("click");
+ tree.find(".badge.cursor-pointer.text-muted").simulate("click");
const button = tree.find("span.input-group-text.cursor-pointer");
expect(button.html()).toMatch(/fa-copy/);
@@ -282,7 +282,7 @@ describe(" preview", () => {
silenceFormStore.data.autofillMatchers = false;
const tree = MountedSilenceForm();
- tree.find(".btn.cursor-pointer.text-muted").simulate("click");
+ tree.find(".badge.cursor-pointer.text-muted").simulate("click");
const input = tree.find("input.form-control").at(2);
expect(input.props().value).toMatch(/http:\/\/localhost\/\?m=/);
diff --git a/ui/src/Components/SilenceModal/SilenceForm.tsx b/ui/src/Components/SilenceModal/SilenceForm.tsx
index 80b41b8fa..f60ca86ef 100644
--- a/ui/src/Components/SilenceModal/SilenceForm.tsx
+++ b/ui/src/Components/SilenceModal/SilenceForm.tsx
@@ -232,7 +232,7 @@ const SilenceForm: FC<{
/>
setShowPreview(!showPreview)}
>
diff --git a/ui/src/Styles/Components/WithClick.scss b/ui/src/Styles/Components/WithClick.scss
new file mode 100644
index 000000000..08e16797c
--- /dev/null
+++ b/ui/src/Styles/Components/WithClick.scss
@@ -0,0 +1,41 @@
+// https://github.com/mladenplavsic/css-ripple-effect
+.with-click {
+ position: relative;
+ overflow: hidden;
+ transform: translate3d(0, 0, 0);
+
+ &:after {
+ content: "";
+ display: block;
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ pointer-events: none;
+ background-image: radial-gradient(
+ circle,
+ $with-click-default 10%,
+ transparent 10.01%
+ );
+ background-repeat: no-repeat;
+ background-position: 50%;
+ transform: scale(10, 10);
+ opacity: 0;
+ transition: transform 0.4s, opacity 0.4s;
+ }
+
+ &.with-click-dark:after {
+ background-image: radial-gradient(
+ circle,
+ $with-click-dark 10%,
+ transparent 10.01%
+ );
+ }
+
+ &:active:after {
+ transform: scale(0, 0);
+ opacity: 0.2;
+ transition: 0s;
+ }
+}
diff --git a/ui/src/Styles/Components/_index.scss b/ui/src/Styles/Components/_index.scss
index f9a45291a..2d0a1a737 100644
--- a/ui/src/Styles/Components/_index.scss
+++ b/ui/src/Styles/Components/_index.scss
@@ -25,3 +25,4 @@
@import "Tooltip";
@import "Fetcher";
@import "Toast";
+@import "WithClick";
diff --git a/ui/src/Styles/DarkTheme.scss b/ui/src/Styles/DarkTheme.scss
index 890541536..ed65c993c 100644
--- a/ui/src/Styles/DarkTheme.scss
+++ b/ui/src/Styles/DarkTheme.scss
@@ -59,6 +59,9 @@ $progress-bg: $black;
$dropdown-bg: darken($gray-800, 2%);
+$with-click-default: $white;
+$with-click-dark: $white;
+
@import "Styles/RebootlessBootstrap";
@import "~bootswatch/dist/darkly/bootswatch";
diff --git a/ui/src/Styles/LightTheme.scss b/ui/src/Styles/LightTheme.scss
index d8c5793d5..71337c6a4 100644
--- a/ui/src/Styles/LightTheme.scss
+++ b/ui/src/Styles/LightTheme.scss
@@ -41,6 +41,9 @@ $pagination-disabled-bg: $gray-300;
$progress-bg: darken($light, 10%);
+$with-click-default: $black;
+$with-click-dark: $white;
+
@import "Styles/RebootlessBootstrap";
@import "~bootswatch/dist/flatly/bootswatch";
|