Skip to content

Commit d217716

Browse files
author
Sine Jespersen
committed
5389: add alt text to button
1 parent 475d047 commit d217716

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

src/stories/Library/Buttons/icon-button/IconButton.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export default {
1111
defaultValue: "icons/collection/Menu.svg",
1212
control: "text",
1313
},
14+
altText: {
15+
defaultValue: "Denne knap sorterer listen efter dato",
16+
control: "text",
17+
},
1418
},
1519
parameters: {
1620
design: {

src/stories/Library/Buttons/icon-button/IconButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
interface IconButtonProps {
22
src: string;
3+
altText: string;
34
}
4-
const IconButton: React.FC<IconButtonProps> = ({ src }) => {
5+
const IconButton: React.FC<IconButtonProps> = ({ src, altText }) => {
56
return (
67
<button className="dpl-icon-button" type="button">
7-
<img src={src} alt="" />
8+
<img src={src} alt={altText} />
89
</button>
910
);
1011
};

src/stories/Library/list-buttons/ListButtons.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@ export const ListButton: React.FC<ListButtonProps> = ({
2121
</div>
2222
<div className="dpl-list-buttons__buttons">
2323
<div className="dpl-list-buttons__buttons__button">
24-
<IconButton src="icons/collection/Menu.svg" />
24+
<IconButton
25+
altText="Denne knap sorterer listen efter afleveringsdato"
26+
src="icons/collection/Menu.svg"
27+
/>
2528
</div>
2629
<div className="dpl-list-buttons__buttons__button">
27-
<IconButton src="icons/collection/Various.svg" />
30+
<IconButton
31+
altText="Denne knap sorterer listen i stakke"
32+
src="icons/collection/Various.svg"
33+
/>
2834
</div>
2935
<div className="dpl-list-buttons__buttons__button">
3036
<Button

0 commit comments

Comments
 (0)