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

Add EventListStacked component. #613

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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({});
Loading