Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gab-social
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
gab
social
gab-social
Commits
421111f5
Commit
421111f5
authored
Sep 14, 2020
by
mgabdev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added isAddable prop to GroupCollectionItem
• Added: - isAddable prop to GroupCollectionItem
parent
d198695b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
app/javascript/gabsocial/components/group_collection_item.js
app/javascript/gabsocial/components/group_collection_item.js
+14
-2
No files found.
app/javascript/gabsocial/components/group_collection_item.js
View file @
421111f5
...
...
@@ -9,6 +9,7 @@ import { PLACEHOLDER_MISSING_HEADER_SRC, CX } from '../constants'
import
{
shortNumberFormat
}
from
'
../utils/numbers
'
import
Image
from
'
./image
'
import
Text
from
'
./text
'
import
GroupActionButton
from
'
./group_action_button
'
class
GroupCollectionItem
extends
ImmutablePureComponent
{
...
...
@@ -18,6 +19,7 @@ class GroupCollectionItem extends ImmutablePureComponent {
group
,
relationships
,
isHidden
,
isAddable
,
}
=
this
.
props
if
(
!
relationships
)
return
null
...
...
@@ -28,7 +30,6 @@ class GroupCollectionItem extends ImmutablePureComponent {
const
coverSrc
=
group
.
get
(
'
cover_image_url
'
)
||
''
const
coverMissing
=
coverSrc
.
indexOf
(
PLACEHOLDER_MISSING_HEADER_SRC
)
>
-
1
||
!
coverSrc
if
(
isHidden
)
{
return
(
<
React
.
Fragment
>
...
...
@@ -55,6 +56,9 @@ class GroupCollectionItem extends ImmutablePureComponent {
bgSubtle_onHover
:
isMember
,
})
let
groupTitle
=
group
.
get
(
'
title
'
)
||
''
if
(
isAddable
&&
groupTitle
.
length
>
52
)
groupTitle
=
`
${
groupTitle
.
substring
(
0
,
52
).
trim
()}
...`
return
(
<
div
className
=
{
_s
.
d
}
>
<
NavLink
...
...
@@ -116,7 +120,7 @@ class GroupCollectionItem extends ImmutablePureComponent {
<
div
className
=
{[
_s
.
d
,
_s
.
px10
,
_s
.
my10
].
join
(
'
'
)}
>
<
Text
color
=
'
primary
'
size
=
'
medium
'
weight
=
'
bold
'
>
{
group
.
get
(
'
title
'
)
}
{
group
Title
}
<
/Text
>
<
div
className
=
{[
_s
.
d
,
_s
.
flexRow
,
_s
.
aiCenter
,
_s
.
mt5
,
_s
.
mb5
].
join
(
'
'
)}
>
...
...
@@ -126,6 +130,13 @@ class GroupCollectionItem extends ImmutablePureComponent {
{
intl
.
formatMessage
(
messages
.
members
)}
<
/Text
>
<
/div
>
{
isAddable
&&
<
div
className
=
{[
_s
.
d
,
_s
.
pt10
].
join
(
'
'
)}
>
<
GroupActionButton
group
=
{
group
}
relationships
=
{
relationships
}
/
>
<
/div
>
}
<
/div
>
<
/NavLink
>
...
...
@@ -152,6 +163,7 @@ GroupCollectionItem.propTypes = {
group
:
ImmutablePropTypes
.
map
,
relationships
:
ImmutablePropTypes
.
map
,
isHidden
:
PropTypes
.
bool
,
isAddable
:
PropTypes
.
bool
,
}
export
default
injectIntl
(
connect
(
mapStateToProps
)(
GroupCollectionItem
))
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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