Move version label to top right for plugin (#941)

This commit is contained in:
Chen-I Lim 2021-08-11 16:55:19 -07:00 committed by GitHub
parent 2287931882
commit 994ed01b49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 7 deletions

View file

@ -46,12 +46,13 @@ const SidebarUserMenu = React.memo(() => {
<LogoIcon/> <LogoIcon/>
<span>{'Boards'}</span> <span>{'Boards'}</span>
</>} </>}
<div className='versionFrame'> {focalboardTitle &&
<div className='version'> <div className='versionFrame'>
{`v${Constants.versionString}`} <div className='version'>
</div> {`v${Constants.versionString}`}
{showVersionBadge && <div className='versionBadge'>{'BETA'}</div>} </div>
</div> {showVersionBadge && <div className='versionBadge'>{'BETA'}</div>}
</div>}
</div> </div>
</div> </div>
<Menu> <Menu>

View file

@ -13,4 +13,25 @@
.HelpIcon { .HelpIcon {
font-size: 20px; font-size: 20px;
} }
.versionFrame {
display: flex;
flex-direction: row;
align-items: center;
}
.version {
font-size: 11px;
line-height: 11px;
font-weight: 500;
color: rgba(var(--center-channel-color-rgb), 0.7);
}
.versionBadge {
font-size: 10px;
line-height: 11px;
font-weight: 500;
margin-left: 3px;
color: rgba(var(--center-channel-color-rgb), 0.7);
}
} }

View file

@ -6,11 +6,24 @@ import React from 'react'
import './topBar.scss' import './topBar.scss'
import HelpIcon from '../widgets/icons/help' import HelpIcon from '../widgets/icons/help'
import {Utils} from '../utils' import {Utils} from '../utils'
import {Constants} from '../constants'
const TopBar = React.memo((): JSX.Element => { const TopBar = React.memo((): JSX.Element => {
if (Utils.isFocalboardPlugin()) { if (Utils.isFocalboardPlugin()) {
return <></> return (
<div
className='TopBar'
>
<div className='versionFrame'>
<div className='version'>
{`v${Constants.versionString}`}
</div>
<div className='versionBadge'>{'BETA'}</div>
</div>
</div>
)
} }
return ( return (
<div <div
className='TopBar' className='TopBar'