scinote-web/app/javascript/packs/shared/navigation/components/ActivityDateElement.jsx

38 lines
834 B
React
Raw Normal View History

2017-08-02 23:27:05 +08:00
import React from "react";
import PropTypes from "prop-types";
2017-08-22 19:20:06 +08:00
import Moment from "react-moment";
import styled from "styled-components";
import { WHITE_COLOR } from "../../../app/constants/colors"
const StyledLi = styled.li`
margin-bottom: 1em;
`
const StyledSpan = styled.span`
display: inline;
padding: 5px 30px;
font-size: 1em;
font-weight: bold;
line-height: 1;
color: ${WHITE_COLOR};
white-space: nowrap;
vertical-align: baseline;
border-radius: .25em;
`;
2017-08-02 23:27:05 +08:00
2017-08-07 19:51:22 +08:00
const ActivityDateElement = ({ date }) =>
2017-08-22 19:20:06 +08:00
<StyledLi className="text-center">
<StyledSpan className="label label-primary">
<Moment format="DD.MM.YYYY">
{date}
</Moment>
</StyledSpan>
</StyledLi>;
2017-08-02 23:27:05 +08:00
ActivityDateElement.propTypes = {
2017-08-07 19:51:22 +08:00
date: PropTypes.instanceOf(Date).isRequired
};
2017-08-02 23:27:05 +08:00
export default ActivityDateElement;