File size: 845 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from 'react';
import styled from 'styled-components';

import colors from '../../utils/colors';
import ChannelName from '../ChannelName';

const StyledChannel = styled.div`
  margin: 2px 0 2px 8px;
  padding: 0 8px;
  height: 32px;
  background-color: ${props => (props.isSelected ? colors.channelSelected : 0)};
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;

  :hover {
    background-color: ${props => (props.isSelected ? colors.channelSelected : colors.grayLight)};

    span {
      color: ${props => (props.isSelected ? 0 : colors.channelHoveredText)};
    }
  }
`;

const Channel = ({ name, isSelected, onClick }) => (
  <StyledChannel isSelected={isSelected} onClick={onClick}>
    <ChannelName name={name} textColor={isSelected && '#fff'} />
  </StyledChannel>
);

export default Channel;