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 marginLeft: theme.spacing.unit + 40,
11 },
12 bold: {
13 fontWeight: 'bold',
14 },
15});
16
17const SetTitle = ({ op, classes }) => {
18 return (
19 <div className={classes.main}>
20 <Author author={op.author} className={classes.bold} />
21 <span> changed the title from </span>
22 <span className={classes.bold}>{op.was}</span>
23 <span> to </span>
24 <span className={classes.bold}>{op.title}</span>
25 <Date date={op.date} />
26 </div>
27 );
28};
29
30SetTitle.fragment = gql`
31 fragment SetTitle on TimelineItem {
32 ... on SetTitleTimelineItem {
33 date
34 author {
35 name
36 email
37 displayName
38 }
39 title
40 was
41 }
42 }
43`;
44
45export default withStyles(styles)(SetTitle);