From 022f510369688084af5bcf314a97fd332d7ee265 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 4 Feb 2020 22:03:21 +0100 Subject: webui: convert more things to typescript --- webui/src/Author.tsx | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 webui/src/Author.tsx (limited to 'webui/src/Author.tsx') diff --git a/webui/src/Author.tsx b/webui/src/Author.tsx new file mode 100644 index 00000000..475244db --- /dev/null +++ b/webui/src/Author.tsx @@ -0,0 +1,28 @@ +import Tooltip from '@material-ui/core/Tooltip/Tooltip'; +import MAvatar from '@material-ui/core/Avatar'; +import React from 'react'; + +import { AuthoredFragment } from './Author.generated'; + +type Props = AuthoredFragment; +const Author = ({ author, ...props }: Props) => { + if (!author.email) { + return {author.displayName}; + } + + return ( + + {author.displayName} + + ); +}; + +export const Avatar = ({ author, ...props }: Props) => { + if (author.avatarUrl) { + return ; + } + + return {author.displayName[0]}; +}; + +export default Author; -- cgit From 9ddcb4b09215f942cb7889f9756d426ad3c90253 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 11 Feb 2020 20:54:01 +0100 Subject: webui: force import order --- webui/src/Author.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui/src/Author.tsx') diff --git a/webui/src/Author.tsx b/webui/src/Author.tsx index 475244db..20de583a 100644 --- a/webui/src/Author.tsx +++ b/webui/src/Author.tsx @@ -1,5 +1,5 @@ -import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import MAvatar from '@material-ui/core/Avatar'; +import Tooltip from '@material-ui/core/Tooltip/Tooltip'; import React from 'react'; import { AuthoredFragment } from './Author.generated'; -- cgit From d0a6da286a28e79ae3bb75af41219c4cc4df20b0 Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Wed, 12 Feb 2020 23:09:45 +0100 Subject: webui: finish TypeScript conversion --- webui/src/Author.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'webui/src/Author.tsx') diff --git a/webui/src/Author.tsx b/webui/src/Author.tsx index 20de583a..852cd2b7 100644 --- a/webui/src/Author.tsx +++ b/webui/src/Author.tsx @@ -4,7 +4,11 @@ import React from 'react'; import { AuthoredFragment } from './Author.generated'; -type Props = AuthoredFragment; +type Props = AuthoredFragment & { + className?: string; + bold?: boolean; +}; + const Author = ({ author, ...props }: Props) => { if (!author.email) { return {author.displayName}; -- cgit