aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/Author.js
diff options
context:
space:
mode:
authorQuentin Gliech <quentingliech@gmail.com>2019-03-30 20:48:19 +0100
committerQuentin Gliech <quentingliech@gmail.com>2019-03-30 20:50:59 +0100
commit22089b5e628f1356e517d24d0346a8ec2def97fc (patch)
tree9e9a12e015433500042b1acfbac3e8ee2b4eb2f4 /webui/src/Author.js
parent850b9db8744c47b3f42b877078678f62ce77e38d (diff)
downloadgit-bug-22089b5e628f1356e517d24d0346a8ec2def97fc.tar.gz
webui: Rework timeline style
Diffstat (limited to 'webui/src/Author.js')
-rw-r--r--webui/src/Author.js29
1 files changed, 13 insertions, 16 deletions
diff --git a/webui/src/Author.js b/webui/src/Author.js
index 7285ed4b..7bb1bf3c 100644
--- a/webui/src/Author.js
+++ b/webui/src/Author.js
@@ -1,28 +1,25 @@
-import { withStyles } from '@material-ui/core/styles';
import Tooltip from '@material-ui/core/Tooltip/Tooltip';
+import MAvatar from '@material-ui/core/Avatar';
import React from 'react';
-const styles = theme => ({
- author: {
- ...theme.typography.body2,
- },
- bold: {
- fontWeight: 'bold',
- },
-});
-
-const Author = ({ author, bold, classes }) => {
- const klass = bold ? [classes.author, classes.bold] : [classes.author];
-
+const Author = ({ author, ...props }) => {
if (!author.email) {
- return <span className={klass.join(' ')}>{author.displayName}</span>;
+ return <span {...props}>{author.displayName}</span>;
}
return (
<Tooltip title={author.email}>
- <span className={klass.join(' ')}>{author.displayName}</span>
+ <span {...props}>{author.displayName}</span>
</Tooltip>
);
};
-export default withStyles(styles)(Author);
+export const Avatar = ({ author, ...props }) => {
+ if (author.avatarUrl) {
+ return <MAvatar src={author.avatarUrl} {...props} />;
+ }
+
+ return <MAvatar {...props}>{author.displayName[0]}</MAvatar>;
+};
+
+export default Author;