Added isStatic prop to GroupListItem for non-navigation
• Added: - isStatic prop to GroupListItem for non-navigation for Introduction page
This commit is contained in:
parent
b26cd650c6
commit
d505d63c6b
@ -10,6 +10,7 @@ import { shortNumberFormat } from '../utils/numbers'
|
|||||||
import Button from './button'
|
import Button from './button'
|
||||||
import Image from './image'
|
import Image from './image'
|
||||||
import Text from './text'
|
import Text from './text'
|
||||||
|
import Dummy from './dummy'
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
members: { id: 'groups.card.members', defaultMessage: 'Members' },
|
members: { id: 'groups.card.members', defaultMessage: 'Members' },
|
||||||
@ -40,6 +41,7 @@ class GroupListItem extends ImmutablePureComponent {
|
|||||||
isAddable: PropTypes.bool,
|
isAddable: PropTypes.bool,
|
||||||
isHidden: PropTypes.bool,
|
isHidden: PropTypes.bool,
|
||||||
isLast: PropTypes.bool,
|
isLast: PropTypes.bool,
|
||||||
|
isStatic: PropTypes.bool,
|
||||||
onToggleMembership: PropTypes.func.isRequired,
|
onToggleMembership: PropTypes.func.isRequired,
|
||||||
relationships: ImmutablePropTypes.map,
|
relationships: ImmutablePropTypes.map,
|
||||||
}
|
}
|
||||||
@ -72,6 +74,7 @@ class GroupListItem extends ImmutablePureComponent {
|
|||||||
isAddable,
|
isAddable,
|
||||||
isLast,
|
isLast,
|
||||||
isHidden,
|
isHidden,
|
||||||
|
isStatic,
|
||||||
relationships,
|
relationships,
|
||||||
} = this.props
|
} = this.props
|
||||||
const { hovering } = this.state
|
const { hovering } = this.state
|
||||||
@ -112,9 +115,11 @@ class GroupListItem extends ImmutablePureComponent {
|
|||||||
const addButtonColor = isMember ? hovering ? 'danger' : 'tertiary' : 'brand'
|
const addButtonColor = isMember ? hovering ? 'danger' : 'tertiary' : 'brand'
|
||||||
const addButtonTitle = isMember ? hovering ? 'Leave Group' : 'You are a member' : 'Join Group'
|
const addButtonTitle = isMember ? hovering ? 'Leave Group' : 'You are a member' : 'Join Group'
|
||||||
|
|
||||||
|
const Wrapper = !isStatic ? NavLink : Dummy
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={containerClasses}>
|
<div className={containerClasses}>
|
||||||
<NavLink
|
<Wrapper
|
||||||
to={`/groups/${group.get('id')}`}
|
to={`/groups/${group.get('id')}`}
|
||||||
className={containerLinkClasses}
|
className={containerLinkClasses}
|
||||||
>
|
>
|
||||||
@ -140,7 +145,7 @@ class GroupListItem extends ImmutablePureComponent {
|
|||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</NavLink>
|
</Wrapper>
|
||||||
<div className={[_s.default, _s.justifyContentCenter].join(' ')}>
|
<div className={[_s.default, _s.justifyContentCenter].join(' ')}>
|
||||||
{
|
{
|
||||||
relationships &&
|
relationships &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user