Skip to content

Commit a5dc242

Browse files
authored
Better UI for member cards component (#764)
1 parent 1c07665 commit a5dc242

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

app/assets/stylesheets/application/member-card.scss

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,36 @@
1+
.to-member-cards {
2+
display: flex;
3+
flex-wrap: wrap;
4+
justify-content: space-between;
5+
align-items: stretch;
6+
gap: 20px;
7+
8+
@media(max-width: $screen-lg-min) {
9+
display: block;
10+
}
11+
}
12+
13+
.to-member-card__wrapper {
14+
width: 48%;
15+
16+
@media (max-width: $screen-lg-min) {
17+
width: 100%;
18+
}
19+
}
20+
121
.to-member-card {
222
& {
3-
margin: 16px 0;
423
width: 100%;
524
max-width: 600px;
6-
height: 178px;
25+
min-height: 178px;
726
background-color: white;
827
box-shadow: 0 0 3px $palette-grey;
9-
display: inline-block;
28+
display: flex;
29+
flex-direction: column;
30+
height: 100%;
31+
border-radius: 4px;
1032

11-
@media(max-width: $screen-sm-min) {
33+
@media(max-width: $screen-lg-min) {
1234
height: auto;
1335
margin: 10px 0;
1436
}
@@ -19,6 +41,7 @@
1941
display: flex;
2042
background-color: $palette-dark-turkey;
2143
padding: 10px 20px;
44+
border-radius: 4px 4px 0 0;
2245
}
2346

2447
&__avatar {
@@ -48,13 +71,16 @@
4871
&__body {
4972
& {
5073
padding: 16px 20px;
74+
display: flex;
75+
flex-direction: column;
76+
justify-content: space-between;
77+
height: 100%;
5178
}
5279

5380
&__description {
5481
margin-bottom: 10px;
5582
color: #666;
5683
font-size: 15px;
57-
height: 44px;
5884

5985
@media(max-width: $screen-sm-min) {
6086
height: auto;
@@ -63,6 +89,7 @@
6389

6490
&__items {
6591
display: flex;
92+
flex-wrap: wrap;
6693

6794
@media(max-width: $screen-sm-min) {
6895
display: block;
@@ -71,11 +98,11 @@
7198
}
7299

73100
&__item {
74-
& {
75-
margin-right: 20px;
76-
font-size: 14px;
77-
color: grey;
78-
}
101+
margin-right: 20px;
102+
font-size: 14px;
103+
color: gray;
104+
overflow-wrap: break-word;
105+
white-space: normal;
79106

80107
a {
81108
color: grey;

app/views/users/_member_card.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="col-lg-6 col-sm-12">
1+
<div class="to-member-card__wrapper">
22
<div class="to-member-card">
33
<div class="to-member-card__header">
44
<div class="to-member-card__header__avatar"><%= image_tag avatar_url(member.user, 48) %></div>

app/views/users/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</div>
2121
</div>
2222

23-
<div class="row to-member-cards">
23+
<div class="to-member-cards">
2424
<%= render partial: 'member_card', collection: @member_view_models, as: :member %>
2525
</div>
2626

0 commit comments

Comments
 (0)