Fix order note when no user was given

This commit is contained in:
dominik-zeglen 2020-07-13 11:21:52 +02:00
parent 214dcae487
commit 8173624fca
3 changed files with 1013 additions and 7 deletions

View file

@ -79,14 +79,16 @@ export const TimelineNote: React.FC<TimelineNoteProps> = props => {
return ( return (
<div className={classes.root}> <div className={classes.root}>
{user && (
<Avatar <Avatar
className={classes.avatar} className={classes.avatar}
style={{ background: palette[CRC.str(user.email) % palette.length] }} style={{ background: palette[CRC.str(user.email) % palette.length] }}
> >
<PersonIcon /> <PersonIcon />
</Avatar> </Avatar>
)}
<div className={classes.title}> <div className={classes.title}>
<Typography>{user.email}</Typography> <Typography>{user?.email}</Typography>
<Typography> <Typography>
<DateTime date={date} /> <DateTime date={date} />
</Typography> </Typography>

View file

@ -825,6 +825,30 @@ export const order = (placeholder: string): OrderDetails_order => ({
email: "admin@example.com", email: "admin@example.com",
id: "QWRkcmVzczoxNQ==" id: "QWRkcmVzczoxNQ=="
} }
},
{
__typename: "OrderEvent",
amount: null,
date: "2019-09-17T13:22:24.376193+00:00",
email: null,
emailType: null,
id: "T3JkZXJFdmVudDo0",
message: "This is note",
quantity: null,
type: OrderEventsEnum.NOTE_ADDED,
user: null
},
{
__typename: "OrderEvent",
amount: null,
date: "2019-09-17T13:22:24.376193+00:00",
email: null,
emailType: null,
id: "T3JkZXJFdmVudDo1",
message: "This is note",
quantity: null,
type: OrderEventsEnum.NOTE_ADDED,
user: null
} }
], ],
fulfillments: [ fulfillments: [

File diff suppressed because it is too large Load diff