fix(ui): fix bootstrap v5 style issues

This commit is contained in:
Łukasz Mierzwa
2021-05-21 11:07:06 +01:00
committed by Łukasz Mierzwa
parent 28b071a098
commit 63c3578815
7 changed files with 52 additions and 13 deletions

View File

@@ -64,7 +64,7 @@ const SilenceDetails: FC<{
isUpper = false,
}) => {
const isExpired = parseISO(silence.endsAt) < new Date();
let expiresClass = "text-dark";
let expiresClass = "";
let expiresLabel = "Expires";
if (isExpired) {
expiresClass = "text-danger";
@@ -84,7 +84,7 @@ const SilenceDetails: FC<{
<div className="d-flex flex-fill flex-lg-row flex-column justify-content-between">
<div className="flex-shrink-1 flex-grow-1 mw-1p">
<div>
<span className="badge text-dark px-1 me-1 components-label">
<span className="badge px-1 me-1 components-label silence-detail">
<FontAwesomeIcon
className="text-muted me-1"
icon={faCalendarCheck}
@@ -93,7 +93,7 @@ const SilenceDetails: FC<{
Started <DateFromNow timestamp={silence.startsAt} />
</span>
<span
className={`badge ${expiresClass} px-1 me-1 components-label`}
className={`badge ${expiresClass} px-1 me-1 components-label silence-detail`}
>
<FontAwesomeIcon
className="text-muted me-1"
@@ -104,7 +104,7 @@ const SilenceDetails: FC<{
</span>
</div>
<div className="my-1 d-flex flex-row">
<span className="badge text-dark px-1 me-1 components-label flex-grow-0 flex-shrink-0">
<span className="badge px-1 me-1 components-label silence-detail flex-grow-0 flex-shrink-0">
<FontAwesomeIcon
className="text-muted me-1"
icon={faFingerprint}
@@ -112,13 +112,13 @@ const SilenceDetails: FC<{
/>
ID:
</span>
<span className="badge bg-light px-1 me-1 components-label">
<span className="badge bg-light px-1 me-1 components-label silence-id">
{silence.id}
</span>
<SilenceIDCopyButton id={silence.id} />
</div>
<div className="my-1">
<span className="badge text-dark px-1 me-1 components-label">
<span className="badge px-1 me-1 components-label silence-detail">
<FontAwesomeIcon
className="text-muted me-1"
icon={faHome}
@@ -136,7 +136,7 @@ const SilenceDetails: FC<{
</div>
<div className="d-flex flex-row">
<div className="flex-shrink-0 flex-grow-0">
<span className="badge text-dark px-1 me-1 components-label">
<span className="badge px-1 me-1 components-label silence-detail">
<FontAwesomeIcon
className="text-muted me-1"
icon={faFilter}

View File

@@ -140,7 +140,7 @@ exports[`<ManagedSilence /> matches snapshot with expaned details 1`] = `
<div class=\\"d-flex flex-fill flex-lg-row flex-column justify-content-between\\">
<div class=\\"flex-shrink-1 flex-grow-1 mw-1p\\">
<div>
<span class=\\"badge text-dark px-1 me-1 components-label\\">
<span class=\\"badge px-1 me-1 components-label silence-detail\\">
<svg aria-hidden=\\"true\\"
focusable=\\"false\\"
data-prefix=\\"fas\\"
@@ -157,7 +157,7 @@ exports[`<ManagedSilence /> matches snapshot with expaned details 1`] = `
</svg>
Started 30 minutes ago
</span>
<span class=\\"badge text-dark px-1 me-1 components-label\\">
<span class=\\"badge px-1 me-1 components-label silence-detail\\">
<svg aria-hidden=\\"true\\"
focusable=\\"false\\"
data-prefix=\\"fas\\"
@@ -176,7 +176,7 @@ exports[`<ManagedSilence /> matches snapshot with expaned details 1`] = `
</span>
</div>
<div class=\\"my-1 d-flex flex-row\\">
<span class=\\"badge text-dark px-1 me-1 components-label flex-grow-0 flex-shrink-0\\">
<span class=\\"badge px-1 me-1 components-label silence-detail flex-grow-0 flex-shrink-0\\">
<svg aria-hidden=\\"true\\"
focusable=\\"false\\"
data-prefix=\\"fas\\"
@@ -193,7 +193,7 @@ exports[`<ManagedSilence /> matches snapshot with expaned details 1`] = `
</svg>
ID:
</span>
<span class=\\"badge bg-light px-1 me-1 components-label\\">
<span class=\\"badge bg-light px-1 me-1 components-label silence-id\\">
04d37636-2350-4878-b382-e0b50353230f
</span>
<div class=\\" tooltip-trigger\\">
@@ -216,7 +216,7 @@ exports[`<ManagedSilence /> matches snapshot with expaned details 1`] = `
</div>
</div>
<div class=\\"my-1\\">
<span class=\\"badge text-dark px-1 me-1 components-label\\">
<span class=\\"badge px-1 me-1 components-label silence-detail\\">
<svg aria-hidden=\\"true\\"
focusable=\\"false\\"
data-prefix=\\"fas\\"
@@ -257,7 +257,7 @@ exports[`<ManagedSilence /> matches snapshot with expaned details 1`] = `
</div>
<div class=\\"d-flex flex-row\\">
<div class=\\"flex-shrink-0 flex-grow-0\\">
<span class=\\"badge text-dark px-1 me-1 components-label\\">
<span class=\\"badge px-1 me-1 components-label silence-detail\\">
<svg aria-hidden=\\"true\\"
focusable=\\"false\\"
data-prefix=\\"fas\\"

View File

@@ -0,0 +1,26 @@
$duration: 800ms;
.components-animation-flash-appear,
.components-animation-flash-enter {
animation-name: flash;
animation-duration: $duration;
animation-timing-function: ease-in-out;
}
@keyframes flash {
0% {
opacity: 1;
}
25% {
opacity: 0;
}
50% {
opacity: 1;
}
75% {
opacity: 0;
}
100% {
opacity: 1;
}
}

View File

@@ -9,6 +9,14 @@
border-left-width: 3px;
border-left-color: $silence-border;
}
.silence-detail {
color: $silence-color;
}
.silence-id {
color: $silence-id;
}
}
.components-managed-silence-icon {

View File

@@ -26,3 +26,4 @@
@import "Fetcher";
@import "Toast";
@import "WithClick";
@import "Flash";

View File

@@ -75,6 +75,8 @@ $alert-bg: $list-group-bg;
$alert-history-inactive: lighten($gray-700, 2%);
$alertgroup-body-bg: lighten($gray-700, 5%);
$alertgroup-footer-bg: lighten($gray-700, 2%);
$silence-id: $white;
$silence-color: $white;
$silence-bg: lighten($gray-900, 2%);
$silence-border: $black;
$silence-comment-color: $gray-400;

View File

@@ -56,6 +56,8 @@ $alert-bg: $white;
$alert-history-inactive: lighten($light, 1%);
$alertgroup-body-bg: $white;
$alertgroup-footer-bg: $gray-100;
$silence-id: $dark;
$silence-color: $dark;
$silence-bg: $gray-100;
$silence-border: $gray-700;
$silence-comment-color: $gray-800;