Skip to content

Commit c12e8f6

Browse files
author
Sine Jespersen
committed
5380: moved toggle button, added controlled inputs
1 parent a933cfa commit c12e8f6

File tree

6 files changed

+32
-8
lines changed

6 files changed

+32
-8
lines changed

base.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
@import "./src/stories/Library/Modals/modal-text/modal-text";
4747
@import "./src/stories/Library/Modals/modal-pause/modal-pause";
4848
@import "./src/stories/Library/material-page/material-page";
49-
@import "./src/stories/Library/toggle-button/toggle-button";
49+
@import "./src/stories/Library/Buttons/toggle-button/toggle-button";
5050
@import "./src/stories/Library/pause-reservation/pause-reservation";
5151
@import "./src/stories/Library/material-header/material-header";
5252
@import "./src/stories/Library/material-header/material-periodikum-select";

src/stories/Library/toggle-button/ToggleButton.stories.tsx renamed to src/stories/Library/Buttons/toggle-button/ToggleButton.stories.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,17 @@ export default {
66
title: "Library / Toggle button",
77
component: ToggleButton,
88
decorators: [withDesign],
9+
parameters: {
10+
design: {
11+
type: "figma",
12+
url: "https://www.figma.com/file/xouARmJCONbzbZhpD8XpcM/Brugerprofil?node-id=607%3A35282",
13+
},
14+
},
915
argTypes: {
1016
isChecked: {
1117
defaultValue: false,
1218
},
1319
},
14-
parameters: {},
1520
} as ComponentMeta<typeof ToggleButton>;
1621

1722
const Template: ComponentStory<typeof ToggleButton> = (args) => (

src/stories/Library/pause-reservation/PauseReservation.stories.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,21 @@ export default {
1010
isChecked: {
1111
defaultValue: true,
1212
},
13+
text: {
14+
control: "text",
15+
defaultValue: "Sæt fysiske reserveringer på pause",
16+
},
17+
dates: {
18+
control: "text",
19+
defaultValue: "20.09.2021 - 12.10.2021",
20+
},
21+
},
22+
parameters: {
23+
design: {
24+
type: "figma",
25+
url: "https://www.figma.com/file/xouARmJCONbzbZhpD8XpcM/Brugerprofil?node-id=607%3A35282",
26+
},
1327
},
14-
parameters: {},
1528
} as ComponentMeta<typeof PauseReservation>;
1629

1730
const Template: ComponentStory<typeof PauseReservation> = (args) => (

src/stories/Library/pause-reservation/PauseReservation.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
import ToggleButton from "../toggle-button/ToggleButton";
1+
import ToggleButton from "../Buttons/toggle-button/ToggleButton";
22

33
export type PauseReservationProps = {
44
isChecked: boolean;
5+
text: string;
6+
dates: string;
57
};
68

7-
export const PauseReservation = ({ isChecked }: PauseReservationProps) => {
9+
export const PauseReservation = ({
10+
isChecked,
11+
text,
12+
dates,
13+
}: PauseReservationProps) => {
814
return (
915
<div className="dpl-pause-reservation-component">
1016
<div className="dpl-pause-reservation-component__pagefold" />
1117
<div className="dpl-pause-reservation-component__flex">
1218
<div className="dpl-pause-reservation-component__flex__reservation-icon">
13-
<img src="icons/collection/Reservations.svg" alt="Reservations" />
19+
<img src="icons/collection/Reservations.svg" alt="" />
1420
</div>
1521
<div className="dpl-pause-reservation-component__flex__text">
16-
Sæt fysiske reserveringer på pause
22+
{text}
1723
</div>
1824
{isChecked && (
1925
<span
2026
aria-label="Reservationer er sat på pause i følgende periode"
2127
className="dpl-pause-reservation-component__flex__badge"
2228
>
23-
20.09.2021 - 12.10.2021
29+
{dates}
2430
</span>
2531
)}
2632
<div className="dpl-pause-reservation-component__flex__button">

0 commit comments

Comments
 (0)