Skip to content

Commit 0b782c3

Browse files
committed
VersionList::Row: Make the whole row clickable
1 parent 544c069 commit 0b782c3

File tree

4 files changed

+34
-14
lines changed

4 files changed

+34
-14
lines changed

app/components/version-list/row.hbs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<div local-class="row" ...attributes>
22
<div>
3-
<LinkTo @route="crate.version" @model={{@version.num}}>{{@version.num}}</LinkTo>
3+
<LinkTo
4+
@route="crate.version"
5+
@model={{@version.num}}
6+
local-class="num-link"
7+
>
8+
{{@version.num}}
9+
</LinkTo>
410

511
<span local-class="date">{{date-format @version.created_at 'PPP'}}</span>
612
{{#if @version.yanked}}
@@ -9,10 +15,6 @@
915
</div>
1016

1117
{{#if this.isOwner}}
12-
<YankButton @version={{@version}} />
13-
{{else}}
14-
<LinkTo @route="crate.version" @model={{@version.num}} local-class="arrow">
15-
{{svg-jar "right-arrow"}}
16-
</LinkTo>
18+
<YankButton @version={{@version}} local-class="yank-button" />
1719
{{/if}}
1820
</div>

app/components/version-list/row.module.css

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,25 @@
22
display: flex;
33
justify-content: space-between;
44
flex-wrap: wrap;
5-
padding: 20px 0;
5+
position: relative;
6+
padding: 20px;
7+
transition: background-color 300ms;
8+
9+
&:hover {
10+
background-color: var(--grey200);
11+
transition: background-color 0ms;
12+
}
13+
}
14+
15+
.num-link {
16+
&::after {
17+
content: '';
18+
position: absolute;
19+
left: 0;
20+
top: 0;
21+
right: 0;
22+
bottom: 0;
23+
}
624
}
725

826
.date {
@@ -15,11 +33,6 @@
1533
composes: yanked from '../../styles/shared/typography.module.css';
1634
}
1735

18-
.arrow {
19-
display: inline-block;
20-
float: right;
21-
22-
svg {
23-
background: #EEECDD;
24-
}
36+
.yank-button {
37+
position: relative;
2538
}

app/styles/application.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
:root {
22
--violet800: hsl(252, 44%, 24%);
33
--grey900: hsl(200, 15%, 19%);
4+
--grey200: hsl(200, 17%, 96%);
45
--green800: hsl(115, 31%, 31%);
56
--yellow500: hsl(44, 100%, 60%);
67

app/styles/crate/versions.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@
2020
}
2121
}
2222
}
23+
24+
.row {
25+
margin: 0 -20px;
26+
}

0 commit comments

Comments
 (0)