Skip to content

Commit 209deeb

Browse files
committed
styling/Use ellipsis when user name overflows connect list
1 parent fa75ad2 commit 209deeb

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

app/assets/stylesheets/hovercard.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
}
4747
}
4848

49+
&--details {
50+
overflow: hidden;
51+
}
52+
4953
&--image {
5054
width: 64px;
5155
height: 64px;
@@ -56,6 +60,8 @@
5660
&--heading {
5761
display: block;
5862
font-weight: 500;
63+
overflow: hidden;
64+
text-overflow: ellipsis;
5965
}
6066

6167
&--sub-heading {

app/assets/stylesheets/user-preview.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,19 @@
2121
font-weight: 500;
2222
font-size: 16px;
2323
font-family: Helvetica, sans-serif;
24+
overflow: hidden;
25+
text-overflow: ellipsis;
26+
max-width: 130px;
27+
display: block;
2428
}
2529

2630
&-time-ago {
2731
font-size: 12px;
2832
color: $color-grey;
33+
text-overflow: ellipsis;
34+
max-width: 130px;
35+
display: block;
36+
overflow: hidden;
2937
}
3038
}
3139
}

app/controllers/registrations_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def create
44
format.html { super }
55
format.json do
66
user = User.new(user_params)
7-
7+
88
if user.save
99
sign_in(user)
1010
render json: { message: 'Thanks for signing up, you are now logged in!' }

app/views/users/hovercard.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="hovercard-<%= @hovercard_position %>" data-target="hovercard.card">
22
<div class="arrow"></div>
33
<%= image_tag @user.avatar_url, class: "hovercard--image" %>
4-
<div>
4+
<div class="hovercard--details">
55
<span class="hovercard--heading"><%= @user.name %></span>
66
<div class="horizontal-line--small"></div>
77
<span class="hovercard--content"><%= @user.bio %></span>

0 commit comments

Comments
 (0)