|
|
|
@ -1,22 +1,31 @@
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import styled from 'styled-components';
|
|
|
|
|
import Icon from 'components/Icon';
|
|
|
|
|
import ICONS from 'config/icons';
|
|
|
|
|
import colors from 'config/colors';
|
|
|
|
|
import { Notification } from 'components/Notification';
|
|
|
|
|
import { getIcon } from 'utils/notification';
|
|
|
|
|
import { getIcon, getColor } from 'utils/notification';
|
|
|
|
|
|
|
|
|
|
const Wrapper = styled.div``;
|
|
|
|
|
|
|
|
|
|
const Header = styled.div`
|
|
|
|
|
display: flex;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
background: ${colors.WHITE};
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 5px 10px;
|
|
|
|
|
border-bottom: 1px solid ${colors.BACKGROUND};
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const Left = styled.div`
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
align-items: center;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const Right = styled.div``;
|
|
|
|
|
|
|
|
|
|
const Body = styled.div``;
|
|
|
|
|
|
|
|
|
|
const Title = styled.div`
|
|
|
|
@ -47,20 +56,32 @@ class Group extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { type, groupNotifications, color } = this.props;
|
|
|
|
|
const { type, groupNotifications } = this.props;
|
|
|
|
|
const color = getColor(type);
|
|
|
|
|
return (
|
|
|
|
|
<Wrapper>
|
|
|
|
|
{groupNotifications.length > 1 && (
|
|
|
|
|
<Header onClick={this.toggle}>
|
|
|
|
|
<Icon
|
|
|
|
|
color={color}
|
|
|
|
|
size={30}
|
|
|
|
|
icon={getIcon(type)}
|
|
|
|
|
/>
|
|
|
|
|
<Title
|
|
|
|
|
color={color}
|
|
|
|
|
>{groupNotifications.length} {groupNotifications.length > 1 ? `${type}s` : type}
|
|
|
|
|
</Title>
|
|
|
|
|
<Left>
|
|
|
|
|
<Icon
|
|
|
|
|
color={color}
|
|
|
|
|
size={30}
|
|
|
|
|
icon={getIcon(type)}
|
|
|
|
|
/>
|
|
|
|
|
<Title
|
|
|
|
|
color={color}
|
|
|
|
|
>{groupNotifications.length} {groupNotifications.length > 1 ? `${type}s` : type}
|
|
|
|
|
</Title>
|
|
|
|
|
</Left>
|
|
|
|
|
<Right>
|
|
|
|
|
<Icon
|
|
|
|
|
icon={ICONS.ARROW_DOWN}
|
|
|
|
|
color={colors.TEXT_SECONDARY}
|
|
|
|
|
size={24}
|
|
|
|
|
isActive={this.state.visible}
|
|
|
|
|
canAnimate
|
|
|
|
|
/>
|
|
|
|
|
</Right>
|
|
|
|
|
</Header>
|
|
|
|
|
)}
|
|
|
|
|
<Body>
|
|
|
|
|