-
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.
Merge pull request #530 from danskernesdigitalebibliotek/release/form…
…-sprint-8 Formidling sprint 8
- Loading branch information
Showing
23 changed files
with
271 additions
and
250 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
12 changes: 7 additions & 5 deletions
12
...event-list-page/EventListPage.stories.tsx → ...ent-list-page/ContentListPage.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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import EventListPage from "./EventListPage"; | ||
import ContentListPage from "./ContentListPage"; | ||
|
||
export default { | ||
title: "Blocks/Event List Page", | ||
component: EventListPage, | ||
title: "Blocks/Content List Page", | ||
component: ContentListPage, | ||
parameters: { | ||
design: { | ||
type: "figma", | ||
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?type=design&node-id=7527-54179&mode=dev", | ||
}, | ||
layout: "fullscreen", | ||
}, | ||
} as ComponentMeta<typeof EventListPage>; | ||
} as ComponentMeta<typeof ContentListPage>; | ||
|
||
const Template: ComponentStory<typeof EventListPage> = () => <EventListPage />; | ||
const Template: ComponentStory<typeof ContentListPage> = () => ( | ||
<ContentListPage /> | ||
); | ||
|
||
export const Default = Template.bind({}); |
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
6 changes: 3 additions & 3 deletions
6
...ocks/event-list-page/event-list-page.scss → .../content-list-page/content-list-page.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
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
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
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
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
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
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
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
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,65 @@ | ||
import { ReactComponent as ArrowSmallRight } from "../Arrows/icon-arrow-ui/icon-arrow-ui-small-right.svg"; | ||
import Tag from "../tag/Tag"; | ||
|
||
export type ContentListItemProps = { | ||
eventSeriesId?: string; | ||
image: string; | ||
tagText: string; | ||
title: string; | ||
description: string; | ||
date: string; | ||
time: string; | ||
location: string; | ||
price: string; | ||
href: string; | ||
isStacked?: boolean; | ||
}; | ||
|
||
export const ContentListItem: React.FC<ContentListItemProps> = ({ | ||
image, | ||
tagText, | ||
title, | ||
description, | ||
date, | ||
time, | ||
location, | ||
price, | ||
href, | ||
}) => { | ||
// Hardcoded placeholders for datetime | ||
// These are calculated in the corresponding template in the CMS | ||
const placeholderDateTime = "2023-03-10T15:00"; // ISO format date and time | ||
|
||
return ( | ||
<a href={href} className="content-list-item arrow__hover--right-small"> | ||
<div className="content-list-item__image-container"> | ||
<img src={image} alt={title} className="content-list-item__image" /> | ||
</div> | ||
<div className="content-list-item__content"> | ||
{tagText && ( | ||
<Tag hasBackground className="content-list-item__tag"> | ||
{tagText} | ||
</Tag> | ||
)} | ||
<div className="content-list-item__date">{date}</div> | ||
<h2 className="content-list-item__title">{title}</h2> | ||
<div className="content-list-item__description"> | ||
<p>{description}</p> | ||
</div> | ||
<div className="content-list-item__content-bottom-container"> | ||
<p className="content-list-item__location">{location}</p> | ||
</div> | ||
<div className="content-list-item__content-right-container"> | ||
<time | ||
className="content-list-item__time" | ||
dateTime={placeholderDateTime} | ||
> | ||
{time} | ||
</time> | ||
<p className="content-list-item__pricing">{price}</p> | ||
</div> | ||
</div> | ||
<ArrowSmallRight /> | ||
</a> | ||
); | ||
}; |
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
32 changes: 32 additions & 0 deletions
32
src/stories/Library/content-list-item/ContentListItemStacked.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,32 @@ | ||
import { FC } from "react"; | ||
import { ReactComponent as ArrowSmallRight } from "../Arrows/icon-arrow-ui/icon-arrow-ui-small-right.svg"; | ||
|
||
interface ContentListItemStackedProps { | ||
title: string; | ||
href: string; | ||
time: string; | ||
date: string; | ||
} | ||
|
||
const ContentListItemStacked: FC<ContentListItemStackedProps> = ({ | ||
title, | ||
href = "#", | ||
time, | ||
date, | ||
}) => { | ||
return ( | ||
<a | ||
href={href} | ||
className="content-list-item-stacked arrow__hover--right-small" | ||
> | ||
<h3 className="hide-visually">{title}</h3> | ||
<time className="content-list-item-stacked__content"> | ||
<span className="content-list-item-stacked__date">{date}</span> | ||
<span className="content-list-item-stacked__time">{time}</span> | ||
</time> | ||
<ArrowSmallRight /> | ||
</a> | ||
); | ||
}; | ||
|
||
export default ContentListItemStacked; |
Oops, something went wrong.