Skip to content

Commit

Permalink
Merge pull request #605 from danskernesdigitalebibliotek/release/herm…
Browse files Browse the repository at this point in the history
…od-13

Hermod sprint 13
  • Loading branch information
kasperg authored Apr 30, 2024
2 parents 9fe9d44 + b0cd69b commit d02b907
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 4 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
1 change: 1 addition & 0 deletions public/icons/logo/reload_logo_black.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/icons/logo/reload_logo_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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({});
61 changes: 57 additions & 4 deletions src/stories/Library/opening-hours-editor/opening-hours-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
display: grid;
background: #f8f8f8;
padding: 2.5rem;
min-width: 300px;
width: 350px;
line-height: 1;
}

Expand All @@ -24,11 +24,43 @@
padding: 0.5rem;
color: #555;
background-color: #fff;

&:disabled {
background-color: transparent;
}
}

.opening-hours-editor-form__checkbox {
margin-top: 1.5rem;
margin-bottom: 0.5rem;
display: flex;
gap: 0.5rem;
align-items: center;

input[type="checkbox"] {
width: 2rem;
height: 2rem;
}

label {
margin: 0;
font-size: 0.8rem;
line-height: 1.25;
}
}

.opening-hours-editor-form__table {
tr > td:last-child {
white-space: nowrap;
text-align: right;
}
}

.opening-hours-editor-form__submit,
.opening-hours-editor-form__remove {
.opening-hours-editor-form__remove,
.opening-hours-editor-form__cancel {
cursor: pointer;
border: 0;
margin-top: 1rem;
color: #fff;
padding: 0.75rem 1.5rem;
Expand All @@ -37,7 +69,6 @@
}

.opening-hours-editor-form__submit {
border: 0;
background-color: #22c55e;

&:hover {
Expand All @@ -46,21 +77,43 @@
}

.opening-hours-editor-form__remove {
border: 0;
background-color: #ef4444;

&:hover {
background-color: #dc2626;
}
}

.opening-hours-editor-form__cancel {
background-color: #d1d5db;

&:hover {
background-color: #a1a1aa;
}
}

.opening-hours-editor-event-content {
padding: 5px 10px;
cursor: pointer;
width: 100%;
display: flex;
justify-content: space-between;
background-color: rgba(255, 255, 255, 0.8);
color: black;
}

.opening-hours-editor-event-content__series-icon {
width: 2rem;
height: 2rem;
}

// Override Drupal's default margin for tables inside .fc to eliminate top and bottom spacing
// Fixes the issue where the selected hour starts half an hour later than the actual selection.
.fc table {
margin: 0;
}

// Override Drupal's default border for table rows inside .fc to keep the correct styling for when an hour starts
.fc tr {
border-bottom: unset;
}

0 comments on commit d02b907

Please sign in to comment.