From f716bc1db9af25af96c59f9eee9c34525f7a88f0 Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Thu, 23 Jan 2020 22:49:19 +0100 Subject: [PATCH 1/5] webui: change primary color --- webui/src/App.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/webui/src/App.js b/webui/src/App.js index 4a52eca1dbed3f201aadb54d5d20431ac2b1c2f2..2dddb3eb69b6c804eac06191519fccf71b603039 100644 --- a/webui/src/App.js +++ b/webui/src/App.js @@ -1,5 +1,6 @@ import AppBar from '@material-ui/core/AppBar'; import CssBaseline from '@material-ui/core/CssBaseline'; +import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/styles'; import Toolbar from '@material-ui/core/Toolbar'; import React from 'react'; @@ -9,6 +10,14 @@ import { Link } from 'react-router-dom'; import BugQuery from './bug/BugQuery'; import ListQuery from './list/ListQuery'; +const theme = createMuiTheme({ + palette: { + primary: { + main: '#263238', + }, + }, +}); + const useStyles = makeStyles(theme => ({ appTitle: { ...theme.typography.h6, @@ -21,7 +30,7 @@ export default function App() { const classes = useStyles(); return ( - <> + @@ -34,6 +43,6 @@ export default function App() { - + ); } From 8f6bc245038ce7197034877bf0fd5ddcb8d3e24d Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Thu, 23 Jan 2020 23:05:34 +0100 Subject: [PATCH 2/5] webui: fix AppBar --- webui/src/App.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webui/src/App.js b/webui/src/App.js index 2dddb3eb69b6c804eac06191519fccf71b603039..145cd90da215528ade5d6899bd4f18ac335af480 100644 --- a/webui/src/App.js +++ b/webui/src/App.js @@ -19,10 +19,12 @@ const theme = createMuiTheme({ }); const useStyles = makeStyles(theme => ({ + offset: theme.mixins.toolbar, appTitle: { ...theme.typography.h6, color: 'white', textDecoration: 'none', + flexGrow: 1, }, })); @@ -32,13 +34,14 @@ export default function App() { return ( - + git-bug webui +
From def48e53f4ae206a10d0973439efdd7769e91100 Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Thu, 23 Jan 2020 23:37:59 +0100 Subject: [PATCH 3/5] webui: display current identity in the AppBar --- webui/src/App.js | 12 ++++++--- webui/src/CurrentIdentity.js | 51 ++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 webui/src/CurrentIdentity.js diff --git a/webui/src/App.js b/webui/src/App.js index 145cd90da215528ade5d6899bd4f18ac335af480..357782682f95d60fa87c62967d42f763d16b6303 100644 --- a/webui/src/App.js +++ b/webui/src/App.js @@ -9,6 +9,7 @@ import { Link } from 'react-router-dom'; import BugQuery from './bug/BugQuery'; import ListQuery from './list/ListQuery'; +import CurrentIdentity from './CurrentIdentity'; const theme = createMuiTheme({ palette: { @@ -24,6 +25,8 @@ const useStyles = makeStyles(theme => ({ ...theme.typography.h6, color: 'white', textDecoration: 'none', + }, + headerLeft: { flexGrow: 1, }, })); @@ -36,9 +39,12 @@ export default function App() { - - git-bug webui - +
+ + git-bug webui + +
+
diff --git a/webui/src/CurrentIdentity.js b/webui/src/CurrentIdentity.js new file mode 100644 index 0000000000000000000000000000000000000000..c8afc531559e7b4d2059ece0987a73845a1ddafb --- /dev/null +++ b/webui/src/CurrentIdentity.js @@ -0,0 +1,51 @@ +import React from 'react'; +import gql from 'graphql-tag'; +import { Query } from 'react-apollo'; +import Avatar from '@material-ui/core/Avatar'; +import { makeStyles } from '@material-ui/styles'; + +const useStyles = makeStyles(theme => ({ + displayName: { + marginLeft: theme.spacing(2), + }, +})); + +const QUERY = gql` + { + defaultRepository { + userIdentity { + displayName + avatarUrl + } + } + } +`; + +const CurrentIdentity = () => { + const classes = useStyles(); + return ( + + {({ error, data }) => { + if ( + error || + !data || + !data.defaultRepository || + !data.defaultRepository.userIdentity || + !data.defaultRepository.userIdentity.displayName + ) + return <>; + const displayName = + data.defaultRepository.userIdentity.displayName || ''; + const avatar = data.defaultRepository.userIdentity.avatarUrl; + return ( + <> + {displayName.charAt(0).toUpperCase()} +
{displayName}
+ + ); + }} +
+ ); +}; + +export default CurrentIdentity; From 7de5a25ffa0b2c45db9cb2da0e142b5b5b6d5b7d Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Fri, 24 Jan 2020 00:28:18 +0100 Subject: [PATCH 4/5] webui: add logo --- misc/logo/logo-alpha-flat-white.svg | 95 +++++++++++++++++++++++++++++ webui/public/logo.svg | 95 +++++++++++++++++++++++++++++ webui/src/App.js | 20 +++--- 3 files changed, 203 insertions(+), 7 deletions(-) create mode 100644 misc/logo/logo-alpha-flat-white.svg create mode 100644 webui/public/logo.svg diff --git a/misc/logo/logo-alpha-flat-white.svg b/misc/logo/logo-alpha-flat-white.svg new file mode 100644 index 0000000000000000000000000000000000000000..69f8ef5013282cd4ff0e56ea9e5af7a953d38a2e --- /dev/null +++ b/misc/logo/logo-alpha-flat-white.svg @@ -0,0 +1,95 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/webui/public/logo.svg b/webui/public/logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..05f175b030c57985aee0ebac4088c6c18affc8a6 --- /dev/null +++ b/webui/public/logo.svg @@ -0,0 +1,95 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/webui/src/App.js b/webui/src/App.js index 357782682f95d60fa87c62967d42f763d16b6303..b9c573274f11d0b6d027e3fd728ab36676febf59 100644 --- a/webui/src/App.js +++ b/webui/src/App.js @@ -21,13 +21,19 @@ const theme = createMuiTheme({ const useStyles = makeStyles(theme => ({ offset: theme.mixins.toolbar, + filler: { + flexGrow: 1, + }, appTitle: { ...theme.typography.h6, color: 'white', textDecoration: 'none', + display: 'flex', + alignItems: 'center', }, - headerLeft: { - flexGrow: 1, + logo: { + height: '42px', + marginRight: theme.spacing(2), }, })); @@ -39,11 +45,11 @@ export default function App() { -
- - git-bug webui - -
+ + git-bug + git-bug + +
From 70354165ff1956dd0598ff69736fb0436612003c Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Fri, 24 Jan 2020 00:43:12 +0100 Subject: [PATCH 5/5] webui: remove useless conditions --- webui/src/CurrentIdentity.js | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/webui/src/CurrentIdentity.js b/webui/src/CurrentIdentity.js index c8afc531559e7b4d2059ece0987a73845a1ddafb..451979fb7c2afc77dc7dcdacf922aeb6510d4955 100644 --- a/webui/src/CurrentIdentity.js +++ b/webui/src/CurrentIdentity.js @@ -25,22 +25,16 @@ const CurrentIdentity = () => { const classes = useStyles(); return ( - {({ error, data }) => { - if ( - error || - !data || - !data.defaultRepository || - !data.defaultRepository.userIdentity || - !data.defaultRepository.userIdentity.displayName - ) - return <>; - const displayName = - data.defaultRepository.userIdentity.displayName || ''; - const avatar = data.defaultRepository.userIdentity.avatarUrl; + {({ loading, error, data }) => { + if (error || loading || !data.defaultRepository.userIdentity) + return null; + const user = data.defaultRepository.userIdentity; return ( <> - {displayName.charAt(0).toUpperCase()} -
{displayName}
+ + {user.displayName.charAt(0).toUpperCase()} + +
{user.displayName}
); }}