Skip to content

Commit 1aba334

Browse files
GolodhrosB-T-D
authored andcommitted
chore: tweaks notices icon color, storybook and spacing (amundsen-io#2106)
Signed-off-by: Marcos Iglesias <[email protected]>
1 parent 69a3c2d commit 1aba334

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

frontend/amundsen_application/static/js/components/Alert/alert.story.tsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,43 @@ import { NoticeSeverity } from 'config/config-types';
1010
import StorySection from '../StorySection';
1111
import { Alert, AlertList } from '.';
1212

13+
const ALERT_CONTAINER_WIDTH = 425;
14+
1315
export const AlertStory = (): React.ReactNode => (
1416
<>
15-
<StorySection title="Alert">
17+
<StorySection title="Alert" width={ALERT_CONTAINER_WIDTH}>
1618
<Alert
1719
message="Alert text that can be short"
1820
onAction={() => {
1921
alert('action executed!');
2022
}}
2123
/>
2224
</StorySection>
23-
<StorySection title="Alert with long text">
24-
<Alert message="Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam perspiciatis non ipsa officia expedita magnam mollitia, excepturi iste eveniet qui nisi eum illum, quas voluptas, reprehenderit quam molestias cum quisquam!" />
25+
<StorySection title="Alert with long text" width={ALERT_CONTAINER_WIDTH}>
26+
<Alert message="Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam perspiciatis non ipsa officia expedita magnam mollitia, excepturi iste eveniet qui nisi eum illum!" />
27+
</StorySection>
28+
<StorySection
29+
title="Alert with medium long text and action"
30+
width={ALERT_CONTAINER_WIDTH}
31+
>
32+
<Alert
33+
actionText="Action Text"
34+
onAction={() => {
35+
alert('action executed!');
36+
}}
37+
message="Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam perspiciatis"
38+
/>
2539
</StorySection>
26-
<StorySection title="Alert with long text and action">
40+
<StorySection
41+
title="Alert with long text and action"
42+
width={ALERT_CONTAINER_WIDTH}
43+
>
2744
<Alert
2845
actionText="Action Text"
2946
onAction={() => {
3047
alert('action executed!');
3148
}}
32-
message="Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam perspiciatis non ipsa officia expedita magnam mollitia, excepturi iste eveniet qui nisi eum illum, quas voluptas, reprehenderit quam molestias cum quisquam!"
49+
message="Lorem ipsum dolor sit amet consectetur adipisicing elit. Laboriosam perspiciatis non ipsa officia expedita magnam mollitia, excepturi iste eveniet qui nisi eum illum!"
3350
/>
3451
</StorySection>
3552
</>

frontend/amundsen_application/static/js/components/Alert/styles.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $alert-alert-background: #ffe4dd;
2121
.alert {
2222
border-radius: $alert-border-radius;
2323
display: flex;
24-
padding: $spacer-1 $spacer-1 * 1.5 $spacer-1 $spacer-2;
24+
padding: $spacer-1 $spacer-1 $spacer-1 $spacer-2;
2525
justify-content: flex-start;
2626
box-shadow: $elevation-level2;
2727
border: none;
@@ -49,7 +49,7 @@ $alert-alert-background: #ffe4dd;
4949
.info-svg-icon {
5050
flex-shrink: 0;
5151
align-self: center;
52-
margin-right: $spacer-1;
52+
margin-right: $spacer-2;
5353
}
5454

5555
.alert-action {

frontend/amundsen_application/static/js/components/StorySection/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,24 @@
33

44
import * as React from 'react';
55

6+
const DEFAULT_WIDTH = 600;
7+
68
export type BlockProps = {
79
children: React.ReactNode;
810
title: string;
911
text?: string | React.ReactNode;
12+
width?: number;
1013
};
1114

1215
const StorySection: React.FC<BlockProps> = ({
1316
children,
1417
text,
1518
title,
19+
width = DEFAULT_WIDTH,
1620
}: BlockProps) => (
1721
<div
1822
className="story-section"
19-
style={{ padding: '2em 2em 1em', maxWidth: 600 }}
23+
style={{ padding: '2em 2em 1em', maxWidth: width }}
2024
>
2125
<h1 className="text-headline-w1">{title}</h1>
2226
{text && <p className="text-body-w1">{text}</p>}

0 commit comments

Comments
 (0)