Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added list type to ListDescription values [DDFLSBP-543] #610

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions src/stories/Library/Lists/list-description/ListDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { generateId } from "../../horizontal-term-line/HorizontalTermLine";
export type ListData = {
[k: string]: {
value: string[];
type: "standard" | "link";
type: "standard" | "link" | "list";
layout?: "default" | "column";
};
};
Expand All @@ -27,12 +27,27 @@ const ListDescription: React.FC<{ data: ListData; className?: string }> = ({
layout === "column" && "list-description__value--column"
)}
>
{value.map((val) => (
<Fragment key={val}>
{type === "standard" && <span>{val}</span>}
{type === "link" && <span className="link-tag">{val}</span>}
</Fragment>
))}
{type === "standard" &&
value.map((val) => (
<Fragment key={val}>
<span>{val}</span>
</Fragment>
))}

{type === "link" &&
value.map((val) => (
<Fragment key={val}>
<span className="link-tag">{val}</span>
</Fragment>
))}

{type === "list" && (
<ul className="list-description__value--list">
{value.map((val) => (
<li key={val}>{val}</li>
))}
</ul>
)}
</dd>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ const fakeData: ListData = {
type: "standard",
layout: "column",
},
Indhold: {
value: [
"Something to Do",
"Lie to Me",
"People Are People",
"It Doesn't Matter",
"Stories of Old",
"Somebody",
"Master and Servant",
"If You Want",
"Blasphemous Rumours",
],
type: "list",
},
};

export default fakeData;
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ dl.list-description {
flex-direction: column;
}

.list-description__value--list {
list-style: initial;
padding-left: 1em;
Adamik10 marked this conversation as resolved.
Show resolved Hide resolved
}

.link-tag {
@include typography($typo__small-caption);

Expand Down
Loading