Skip to content

Commit 654a071

Browse files
Merge pull request danskernesdigitalebibliotek#181 from itk-dev/feature/links-and-boxes
Feature/links and boxes
2 parents e43f02e + 65cb869 commit 654a071

File tree

4 files changed

+53
-18
lines changed

4 files changed

+53
-18
lines changed

src/stories/Library/Arrows/arrows.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,30 @@
4242
.arrow__link {
4343
text-decoration: none;
4444
}
45+
46+
/* BEM plugin does not support interpolation */
47+
/* stylelint-disable plugin/stylelint-bem-namics */
48+
@mixin arrow($className) {
49+
// Hide arrow
50+
.#{$className} > {
51+
svg {
52+
width: 35px;
53+
visibility: hidden;
54+
opacity: 0;
55+
margin-right: 20px;
56+
}
57+
}
58+
// Show arrow on hover
59+
.#{$className} {
60+
&:hover {
61+
svg {
62+
@include breakpoint-s {
63+
visibility: visible;
64+
opacity: 1;
65+
align-self: center;
66+
justify-self: end;
67+
}
68+
}
69+
}
70+
}
71+
}

src/stories/Library/Lists/list-reservation/ListReservationsAndLoans.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import clsx from "clsx";
22
import { Counter, CounterProps } from "../../counter/Counter";
33
import { StatusLabel, StatusLabelProps } from "../../status-label/StatusLabel";
44
import { Cover } from "../../cover/Cover";
5+
import { ReactComponent as ArrowSmallRight } from "../../Arrows/icon-arrow-ui/icon-arrow-ui-small-right.svg";
56

67
export type ListReservationsAndLoansProps = {
78
cover: {
@@ -42,7 +43,9 @@ export const ListReservationsAndLoans = (
4243
<StatusLabel label="bog" status="outline" />
4344
</div>
4445
<div className="list-reservation__about">
45-
<h3 className="text-header-h4">{cover.title}</h3>
46+
<button className="list-reservation__header">
47+
{cover.title}
48+
</button>
4649
<p className="text-small-caption color-secondary-gray">
4750
{cover.description}
4851
</p>
@@ -98,6 +101,7 @@ export const ListReservationsAndLoans = (
98101
<p className="text-body-medium-medium">Gebyr {fee},-</p>
99102
</div>
100103
) : null}
104+
<ArrowSmallRight />
101105
</div>
102106
</div>
103107
</div>

src/stories/Library/Lists/list-reservation/list-reservation.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ $list-reservation-space-desktop: 24px;
2020
height: 184px;
2121
padding: $list-reservation-space-desktop;
2222
}
23+
24+
&:hover {
25+
filter: drop-shadow(0 4px 20px rgb(72 72 72 / 10%));
26+
}
2327
}
2428

2529
.list-reservation__material {
@@ -86,6 +90,7 @@ $list-reservation-space-desktop: 24px;
8690

8791
.list-reservation__about {
8892
padding-left: 0;
93+
text-align: left;
8994

9095
p {
9196
margin-top: 2px;
@@ -102,6 +107,17 @@ $list-reservation-space-desktop: 24px;
102107
}
103108
}
104109

110+
.list-reservation__header {
111+
@extend %text-header-h4;
112+
padding: 0;
113+
cursor: pointer;
114+
115+
&:hover,
116+
&:focus {
117+
text-decoration: underline;
118+
}
119+
}
120+
105121
.list-reservation__status {
106122
height: 100%;
107123
display: grid;
@@ -113,8 +129,11 @@ $list-reservation-space-desktop: 24px;
113129
}
114130
}
115131

132+
@include arrow("list-reservation__status");
133+
116134
.list-reservation__counter {
117135
display: none;
136+
margin: $s-xs;
118137

119138
@include breakpoint-s {
120139
width: 92px;

src/stories/Library/search-result-item/search-result-item.scss

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,10 @@
1717
&:hover {
1818
filter: drop-shadow(0 4px 20px rgb(72 72 72 / 10%));
1919
}
20-
21-
// Hide arrow
22-
> svg {
23-
width: 35px;
24-
visibility: hidden;
25-
opacity: 0;
26-
margin-right: 20px;
27-
}
28-
// Show arrow on hover
29-
&:hover svg {
30-
@include breakpoint-s {
31-
visibility: visible;
32-
opacity: 1;
33-
align-self: center;
34-
justify-self: end;
35-
}
36-
}
3720
}
3821

22+
@include arrow("search-result-item");
23+
3924
.search-result-item__cover {
4025
grid-row: span 2;
4126

0 commit comments

Comments
 (0)