All files / buffer-web-components/ScheduleTag index.jsx

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48                      1x 1x                                                           1x          
import React from 'react';
import PropTypes from 'prop-types';
import { Text } from '@bufferapp/components';
import {
  curiousBlue,
  transparent,
} from '@bufferapp/components/style/color';
import {
  borderRadius,
} from '@bufferapp/components/style/border';
 
const ScheduleTag = ({ dateString }) =>
  <span
    style={{
      position: 'relative',
      backgroundColor: curiousBlue,
      padding: '0.25rem 0.25rem 0.4rem 0.75rem',
      display: 'inline-block',
      borderRadius: `${borderRadius} 0 0 ${borderRadius}`,
    }}
  >
    <Text
      size={'extra-small'}
      weight={'thin'}
      color={'white'}
    >
      {dateString}
    </Text>
    <span
      style={{
        position: 'absolute',
        right: '-1rem',
        width: 0,
        height: 0,
        top: 0,
        borderTop: `1rem solid ${transparent}`,
        borderBottom: `1rem solid ${transparent}`,
        borderLeft: `1rem solid ${curiousBlue}`,
      }}
    />
  </span>;
 
ScheduleTag.propTypes = {
  dateString: PropTypes.string.isRequired,
};
 
export default ScheduleTag;