-
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.
Introduced markup and CSS for `EventHeader`, now included in `EventPage`. Additionally, made small modifications to the `tag` component to allow the addition of extra CSS classes. In typography, I introduced a placeholder for `.text-header-h1` to facilitate future extension of this class
- Loading branch information
1 parent
9cd6897
commit aed6a2b
Showing
8 changed files
with
178 additions
and
1 deletion.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,29 @@ | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import { withDesign } from "storybook-addon-designs"; | ||
import Event from "./EventPage"; | ||
|
||
export default { | ||
title: "Blocks / Event page", | ||
component: Event, | ||
decorators: [withDesign], | ||
argTypes: { | ||
title: { | ||
defaultValue: "Fernisering Modern Dans", | ||
type: "string", | ||
}, | ||
date: { | ||
defaultValue: "06 Dec - 12 Jan 2022", | ||
type: "string", | ||
}, | ||
}, | ||
parameters: { | ||
design: { | ||
type: "figma", | ||
url: "https://www.figma.com/file/Zx9GrkFA3l4ISvyZD2q0Qi/Designsystem?type=design&node-id=7477-39846&mode=dev", | ||
}, | ||
}, | ||
} as ComponentMeta<typeof Event>; | ||
|
||
const Template: ComponentStory<typeof Event> = (args) => <Event {...args} />; | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { FC } from "react"; | ||
import EventHeader from "../../Library/event-header/EventHeader"; | ||
|
||
type EventPageProps = { | ||
title: string; | ||
date: string; | ||
}; | ||
|
||
const EventPage: FC<EventPageProps> = ({ title, date }) => { | ||
return ( | ||
<article className="event-page"> | ||
<EventHeader title={title} date={date} /> | ||
</article> | ||
); | ||
}; | ||
|
||
export default EventPage; |
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,3 @@ | ||
.event-page { | ||
background-color: $c-global-primary; | ||
} |
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,46 @@ | ||
import { FC } from "react"; | ||
import { Tag } from "../tag/Tag"; | ||
import { Button } from "../Buttons/button/Button"; | ||
|
||
type EventHeaderProps = { | ||
title: string; | ||
date: string; | ||
}; | ||
|
||
const EventHeader: FC<EventHeaderProps> = ({ title, date }) => { | ||
return ( | ||
<header className="event-header"> | ||
<section className="event-header__content"> | ||
<div className="event-header__extra-padding"> | ||
<Tag hasBackground className="event-header__tag"> | ||
UDSTILLING | ||
</Tag> | ||
<time className="event-header__date">{date}</time> | ||
<h1 className="event-header__title">{title}</h1> | ||
</div> | ||
<Button | ||
classNames="event-header__button" | ||
label="Køb billet" | ||
buttonType="none" | ||
disabled={false} | ||
collapsible={false} | ||
size="large" | ||
variant="filled" | ||
/> | ||
</section> | ||
<section className="event-header__visual"> | ||
<img | ||
className="event-header__image" | ||
src="/images/event_image.jpg" | ||
alt="" | ||
/> | ||
<div className="event-header__image-info"> | ||
<span>Photo by Smith on Unsplash </span> | ||
<span>©2021</span> | ||
</div> | ||
</section> | ||
</header> | ||
); | ||
}; | ||
|
||
export default EventHeader; |
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,77 @@ | ||
.event-header { | ||
@include container(medium); | ||
border-bottom: 1px solid $c-global-tertiary-1; | ||
display: grid; | ||
gap: $s-lg; | ||
padding-bottom: $s-2xl; | ||
@include breakpoint-s { | ||
grid-template-columns: 2fr 1fr; | ||
gap: 0; | ||
padding-bottom: 0; | ||
} | ||
} | ||
|
||
.event-header__content, | ||
.event-header__visual { | ||
padding: 0 $s-md; | ||
@include breakpoint-s { | ||
padding: $s-2xl; | ||
} | ||
} | ||
|
||
.event-header__extra-padding { | ||
padding: 0 $s-3xl; | ||
@include breakpoint-s { | ||
padding: 0; | ||
} | ||
} | ||
|
||
.event-header__tag { | ||
margin: $s-md 0; | ||
@include breakpoint-s { | ||
margin: $s-lg 0; | ||
} | ||
} | ||
|
||
.event-header__date { | ||
@extend %text-header-h4; | ||
display: block; | ||
margin-bottom: $s-md; | ||
@include breakpoint-s { | ||
margin-bottom: $s-sm; | ||
} | ||
} | ||
|
||
.event-header__title { | ||
@extend %text-header-h1; | ||
margin-bottom: $s-xl; | ||
@include breakpoint-s { | ||
margin-bottom: $s-5xl; | ||
} | ||
} | ||
|
||
.event-header__button { | ||
width: 100%; | ||
@include breakpoint-s { | ||
width: auto; | ||
} | ||
} | ||
|
||
.event-header__visual { | ||
@include breakpoint-s { | ||
grid-column: 1/2; | ||
grid-row: 1/2; | ||
border-right: 1px solid $c-global-tertiary-1; | ||
} | ||
} | ||
|
||
.event-header__image { | ||
width: 100%; | ||
} | ||
|
||
.event-header__image-info { | ||
@extend %text-small-caption; | ||
margin-top: $s-md; | ||
display: flex; | ||
justify-content: space-between; | ||
} |
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