Beta badge (#404)

This commit is contained in:
Chen-I Lim 2021-05-12 03:03:10 -07:00 committed by GitHub
parent 2f401df55d
commit 8a3b4cacb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 4 deletions

View file

@ -68,7 +68,10 @@ const Sidebar = React.memo((props: Props) => {
<div className='Sidebar octo-sidebar'>
<div className='octo-sidebar-header'>
<div className='heading'>
<SidebarUserMenu whiteLogo={whiteLogo}/>
<SidebarUserMenu
whiteLogo={whiteLogo}
showVersionBadge={Boolean(workspace && workspace.id !== '0')}
/>
</div>
<div className='octo-spacer'/>

View file

@ -10,8 +10,22 @@
width: auto;
}
.versionFrame {
display: flex;
flex-direction: column;
align-items: center;
}
.version {
font-size: 11px;
line-height: 11px;
font-weight: 500;
color: rgba(var(--sidebar-fg), 0.8);
}
.versionBadge {
font-size: 10px;
line-height: 11px;
font-weight: 500;
color: rgba(var(--sidebar-fg), 0.8);
}

View file

@ -20,12 +20,13 @@ import './sidebarUserMenu.scss'
type Props = {
whiteLogo: boolean
showVersionBadge: boolean
}
const SidebarUserMenu = React.memo((props: Props) => {
const history = useHistory()
const [showRegistrationLinkDialog, setShowRegistrationLinkDialog] = useState(false)
const {whiteLogo} = props
const {whiteLogo, showVersionBadge} = props
const intl = useIntl()
return (
<div className='SidebarUserMenu'>
@ -34,8 +35,13 @@ const SidebarUserMenu = React.memo((props: Props) => {
<div className='logo'>
{whiteLogo ? <LogoWithNameWhiteIcon/> : <LogoWithNameIcon/>}
<div className='octo-spacer'/>
<div className='version'>
{`v${Constants.versionString}`}
<div className='versionFrame'>
<div className='version'>
{`v${Constants.versionString}`}
</div>
<div className='versionBadge'>
&nbsp;{showVersionBadge ? 'BETA' : ''}&nbsp;
</div>
</div>
</div>
<UserContext.Consumer>