Skip to content

Commit 896050e

Browse files
committed
5396: Add links to list-empty
1 parent 7a8b89a commit 896050e

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

src/stories/Library/Lists/list-empty/ListEmpty.stories.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ export default {
1111
defaultValue: "Du har i øjeblikket 0 Reserveringer",
1212
control: "text",
1313
},
14+
links: {
15+
control: "object",
16+
defaultValue: [
17+
{
18+
linkText: "link tekst 1",
19+
href: "https://example.com/",
20+
},
21+
{
22+
linkText: "link tekst 2",
23+
href: "https://example.com/",
24+
},
25+
],
26+
},
1427
},
1528
parameters: {
1629
design: {
Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1+
import { Links, LinksProps } from "../../links/Links";
2+
13
interface ListEmptyProps {
24
text: string;
5+
links?: LinksProps[];
36
}
47

5-
const ListEmpty = ({ text }: ListEmptyProps) => {
6-
return <div className="dpl-list-empty">{text}</div>;
8+
const ListEmpty = ({ text, links }: ListEmptyProps) => {
9+
return (
10+
<div className="dpl-list-empty">
11+
<div className="dpl-list-empty__text">{text}</div>
12+
{links && (
13+
<div className="dpl-list-empty__links">
14+
{links.map((item, index) => (
15+
<div key={index} className="dpl-list-empty__link-item">
16+
<Links
17+
linkText={item.linkText}
18+
href={item.href}
19+
classNames={item.classNames}
20+
/>
21+
</div>
22+
))}
23+
</div>
24+
)}
25+
</div>
26+
);
727
};
828

929
export default ListEmpty;

src/stories/Library/Lists/list-empty/list-empty.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
width: 100%;
44
background-color: transparent;
55
display: flex;
6+
flex-direction: column;
67
justify-content: center;
78
align-items: center;
89
border: 1px dotted $c-text-secondary-gray;
@@ -11,4 +12,14 @@
1112
@extend .pt-48;
1213
@extend .pb-48;
1314
@extend .text-body-large;
15+
16+
&__text {
17+
@extend .pb-48;
18+
}
19+
20+
&__links {
21+
display: flex;
22+
flex-direction: row;
23+
column-gap: $s-lg;
24+
}
1425
}

0 commit comments

Comments
 (0)