1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-11-27 08:31:20 +02:00

Show username in sidebar

This commit is contained in:
Chen-I Lim 2021-01-14 18:14:03 -08:00
parent d7eb2651cf
commit 684177d5e2
2 changed files with 17 additions and 2 deletions

View File

@ -29,6 +29,7 @@
flex: 0 0 auto; flex: 0 0 auto;
} }
.octo-sidebar-list { .octo-sidebar-list {
flex: 1 1 auto; flex: 1 1 auto;
overflow-y: auto; overflow-y: auto;
@ -42,12 +43,18 @@
font-weight: 600; font-weight: 600;
padding: 3px 20px; padding: 3px 20px;
margin-bottom: 5px; margin-bottom: 5px;
>.username {
line-height: 30px;
}
>.IconButton { >.IconButton {
background-color: var(--sidebar-bg); background-color: var(--sidebar-bg);
&:hover { &:hover {
background-color: rgba(var(--sidebar-fg), 0.1); background-color: rgba(var(--sidebar-fg), 0.1);
} }
} }
&.show-button { &.show-button {
.hamburger-icon { .hamburger-icon {
display: block; display: block;

View File

@ -1,6 +1,6 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information. // See LICENSE.txt for license information.
import React from 'react' import React, {useContext} from 'react'
import {FormattedMessage, injectIntl, IntlShape} from 'react-intl' import {FormattedMessage, injectIntl, IntlShape} from 'react-intl'
import {Archiver} from '../archiver' import {Archiver} from '../archiver'
@ -8,6 +8,7 @@ import {Board, MutableBoard} from '../blocks/board'
import {BoardView, MutableBoardView} from '../blocks/boardView' import {BoardView, MutableBoardView} from '../blocks/boardView'
import mutator from '../mutator' import mutator from '../mutator'
import {darkTheme, defaultTheme, lightTheme, setTheme} from '../theme' import {darkTheme, defaultTheme, lightTheme, setTheme} from '../theme'
import {UserContext} from '../user'
import {WorkspaceTree} from '../viewModel/workspaceTree' import {WorkspaceTree} from '../viewModel/workspaceTree'
import Button from '../widgets/buttons/button' import Button from '../widgets/buttons/button'
import IconButton from '../widgets/buttons/iconButton' import IconButton from '../widgets/buttons/iconButton'
@ -85,7 +86,14 @@ class Sidebar extends React.Component<Props, State> {
return ( return (
<div className='Sidebar octo-sidebar'> <div className='Sidebar octo-sidebar'>
<div className='octo-sidebar-header'> <div className='octo-sidebar-header'>
{'Matternote'} <UserContext.Consumer>
{(user) => (
<div className='username'>
{user ? user.username : ' '}
</div>
)}
</UserContext.Consumer>
<div className='octo-spacer'/> <div className='octo-spacer'/>
<IconButton <IconButton
onClick={this.hideClicked} onClick={this.hideClicked}