1import { withStyles } from '@material-ui/core/styles';
2import gql from 'graphql-tag';
3import React from 'react';
4import Author from '../Author';
5import Date from '../Date';
6
7const styles = theme => ({
8 main: {
9 ...theme.typography.body2,
10 },
11 bold: {
12 fontWeight: 'bold',
13 },
14});
15
16const SetTitle = ({ op, classes }) => {
17 return (
18 <div className={classes.main}>
19 <Author author={op.author} bold />
20 <span> changed the title from </span>
21 <span className={classes.bold}>{op.was}</span>
22 <span> to </span>
23 <span className={classes.bold}>{op.title}</span>
24 <Date date={op.date} />
25 </div>
26 );
27};
28
29SetTitle.fragment = gql`
30 fragment SetTitle on TimelineItem {
31 ... on SetTitleTimelineItem {
32 date
33 author {
34 name
35 email
36 displayName
37 }
38 title
39 was
40 }
41 }
42`;
43
44export default withStyles(styles)(SetTitle);