Skip to content

Commit

Permalink
Add EventListStacked component.
Browse files Browse the repository at this point in the history
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
LasseStaus committed Apr 29, 2024
1 parent 0a123f7 commit f375c4c
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
@import "./src/stories/Library/opening-hours/opening-hours";
@import "./src/stories/Library/opening-hours/opening-hours-skeleton";
@import "./src/stories/Library/filtered-event-list/filtered-event-list";
@import "./src/stories/Library/event-list-stacked/event-list-stacked";

// Autosuggest block styling needs to be loaded before the rest of the scss for autosuggest
@import "./src/stories/Blocks/autosuggest/autosuggest";
Expand Down
26 changes: 26 additions & 0 deletions src/stories/Library/event-list-stacked/EventListStacked.tsx
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;
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;
}
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({});

0 comments on commit f375c4c

Please sign in to comment.