-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Includes component, story and css. This component will be used on the eventseries page, to display the events in a series. This is likely a temporary solution, as the eventseries page will be restructured later. For now, this will be used and therefore it is necesary to give it its own component / css. DDFFORM-126
- Loading branch information
1 parent
0a123f7
commit f375c4c
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/stories/Library/event-list-stacked/EventListStacked.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from "react"; | ||
import { ContentListItem } from "../content-list-item/ContentListItem"; | ||
import ContentListItemStacked from "../content-list-item/ContentListItemStacked"; | ||
import contentListData from "../content-list/ContentListData"; | ||
|
||
interface PromoteEventsListProps { | ||
title: string; | ||
} | ||
|
||
const EventListStacked: React.FC<PromoteEventsListProps> = ({ title }) => { | ||
return ( | ||
<section className="event-list-stacked"> | ||
<h2 className="event-list-stacked__heading">{title}</h2> | ||
<ContentListItem {...contentListData[0]} /> | ||
{contentListData.map((event) => ( | ||
<ContentListItemStacked | ||
title={event.title} | ||
href={event.href} | ||
time={event.time} | ||
date={event.date} | ||
/> | ||
))} | ||
</section> | ||
); | ||
}; | ||
export default EventListStacked; |
9 changes: 9 additions & 0 deletions
9
src/stories/Library/event-list-stacked/event-list-stacked.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.event-list-stacked { | ||
@include layout-container($layout__max-width--medium); | ||
@include block-spacing(); | ||
} | ||
|
||
.event-list-stacked__heading { | ||
@include typography($typo__h2); | ||
margin-bottom: $s-xl; | ||
} |
21 changes: 21 additions & 0 deletions
21
src/stories/Library/event-list-stacked/eventListStacked.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentMeta, ComponentStory } from "@storybook/react"; | ||
import EventListStacked from "./EventListStacked"; | ||
|
||
export default { | ||
title: "Library/ Stacked Event List", | ||
|
||
component: EventListStacked, | ||
argTypes: { | ||
title: { | ||
defaultValue: "Kommende arrangementer", | ||
control: "text", | ||
description: "Title of the section", | ||
}, | ||
}, | ||
} as ComponentMeta<typeof EventListStacked>; | ||
|
||
const Template: ComponentStory<typeof EventListStacked> = (args) => ( | ||
<EventListStacked {...args} /> | ||
); | ||
|
||
export const FilteredList = Template.bind({}); |