Skip to content

Commit

Permalink
fix(mrc): fix action-banner style and alignement
Browse files Browse the repository at this point in the history
ref: #15742
Signed-off-by: LIDRISSI Hamid <[email protected]>
  • Loading branch information
seven-amid committed Mar 3, 2025
1 parent ad7bd8d commit 15f80d8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
ODS_MESSAGE_VARIANT,
} from '@ovhcloud/ods-components';

import './index.css';

export type ActionBannerProps = {
message: string;
cta: string;
Expand All @@ -35,11 +37,11 @@ export function ActionBanner({
isDismissible={isDismissible}
color={color}
variant={variant}
className="mt-3 flex-row"
className={`mt-3 action-banner action-banner—-${color}`}
data-testid="actionBanner-message_container"
>
<div className="sm:flex sm:flex-row sm:justify-between sm:items-center">
<OdsText>
<div className="w-full">
<OdsText className="action-banner__text block">
<span
dangerouslySetInnerHTML={{
__html: message,
Expand All @@ -48,7 +50,7 @@ export function ActionBanner({
</OdsText>
{onClick && (
<OdsButton
className="sm:mt-0 mt-4 sm:ml-4 ml-0"
className="sm:mt-0 mt-4 ml-0"
data-testid="actionBanner-button"
onClick={onClick}
label={cta}
Expand All @@ -58,13 +60,12 @@ export function ActionBanner({
<OdsLink
data-testid="action-banner-link"
id="action-banner-link"
className="sm:mt-0 mt-4 sm:ml-4 ml-0"
className="sm:mt-0 mt-4 ml-0"
onClick={onClick}
href={href}
target="_blank"
>
{cta}
</OdsLink>
label={cta}
></OdsLink>
)}
</div>
</OdsMessage>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

.action-banner.action-banner-success .action-banner__text::part(text) {
color: var(--ods-color-success-700);
}

.action-banner.action-banner-warning .action-banner__text::part(text) {
color: var(--ods-color-warning-700);
}

.action-banner.action-banner-information .action-banner__text::part(text) {
color: var(--ods-color-information-700);
}

.action-banner.action-banner-danger .action-banner__text::part(text) {
color: var(--ods-color-critical-700);
}

.action-banner.action-banner-critical .action-banner__text::part(text) {
color: var(--ods-color-critical-700);
}

0 comments on commit 15f80d8

Please sign in to comment.