All files / hourly-chart/components/TimezoneInfo index.jsx

80% Statements 4/5
100% Branches 0/0
0% Functions 0/1
80% Lines 4/5
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              1x       1x         1x       1x          
import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import {
  Text,
} from '@bufferapp/components';
 
const style = {
  marginLeft: 'auto',
};
 
const TimezoneInfo = ({ timezone }) =>
  <span style={style}>
    <Text color="nevada" size="small">UTC {moment.tz(timezone).format('Z')}</Text>
  </span>;
 
TimezoneInfo.defaultProps = {
  timezone: 'America/Los_Angeles',
};
 
TimezoneInfo.propTypes = {
  timezone: PropTypes.string,
};
 
export default TimezoneInfo;