Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
mastofe
Commits
87ad942d
Commit
87ad942d
authored
Aug 20, 2018
by
Thibaut Girka
Committed by
ThibG
Aug 22, 2018
Browse files
[Glitch] Display replies count in web UI
Port
4df9cabb
to glitch-soc
parent
801919fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/javascript/flavours/glitch/components/status_action_bar.js
View file @
87ad942d
...
...
@@ -33,6 +33,16 @@ const messages = defineMessages({
embed
:
{
id
:
'
status.embed
'
,
defaultMessage
:
'
Embed
'
},
});
const
obfuscatedCount
=
count
=>
{
if
(
count
<
0
)
{
return
0
;
}
else
if
(
count
<=
1
)
{
return
count
;
}
else
{
return
'
1+
'
;
}
};
@
injectIntl
export
default
class
StatusActionBar
extends
ImmutablePureComponent
{
...
...
@@ -190,7 +200,10 @@ export default class StatusActionBar extends ImmutablePureComponent {
return
(
<
div
className
=
'
status__action-bar
'
>
<
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
anonymousAccess
}
title
=
{
replyTitle
}
icon
=
{
replyIcon
}
onClick
=
{
this
.
handleReplyClick
}
/
>
<
div
className
=
'
status__action-bar__counter
'
>
<
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
anonymousAccess
}
title
=
{
replyTitle
}
icon
=
{
replyIcon
}
onClick
=
{
this
.
handleReplyClick
}
/
>
<
span
className
=
'
status__action-bar__counter__label
'
>
{
obfuscatedCount
(
status
.
get
(
'
replies_count
'
))}
<
/span
>
<
/div
>
<
IconButton
className
=
'
status__action-bar-button
'
disabled
=
{
reblogDisabled
}
active
=
{
status
.
get
(
'
reblogged
'
)}
pressed
=
{
status
.
get
(
'
reblogged
'
)}
title
=
{
reblogDisabled
?
intl
.
formatMessage
(
messages
.
cannot_reblog
)
:
intl
.
formatMessage
(
reblogMessage
)}
icon
=
{
reblogIcon
}
onClick
=
{
this
.
handleReblogClick
}
/
>
<
IconButton
className
=
'
status__action-bar-button star-icon
'
disabled
=
{
anonymousAccess
}
animate
active
=
{
status
.
get
(
'
favourited
'
)}
pressed
=
{
status
.
get
(
'
favourited
'
)}
title
=
{
intl
.
formatMessage
(
messages
.
favourite
)}
icon
=
'
star
'
onClick
=
{
this
.
handleFavouriteClick
}
/
>
{
shareButton
}
...
...
app/javascript/flavours/glitch/styles/components/status.scss
View file @
87ad942d
...
...
@@ -417,15 +417,31 @@
align-items
:
center
;
display
:
flex
;
margin-top
:
8px
;
&
__counter
{
display
:
inline-flex
;
margin-right
:
11px
;
align-items
:
center
;
.status__action-bar-button
{
margin-right
:
4px
;
}
&
__label
{
display
:
inline-block
;
width
:
14px
;
font-size
:
12px
;
font-weight
:
500
;
color
:
$action-button-color
;
}
}
}
.status__action-bar-button
{
float
:
left
;
margin-right
:
18px
;
}
.status__action-bar-dropdown
{
float
:
left
;
height
:
23
.15px
;
width
:
23
.15px
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment