Skip to content

Commit

Permalink
Beta badge (#404)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenilim committed May 12, 2021
1 parent bff7d67 commit 8a29fff
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
5 changes: 4 additions & 1 deletion webapp/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'/>
Expand Down
14 changes: 14 additions & 0 deletions webapp/src/components/sidebar/sidebarUserMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
12 changes: 9 additions & 3 deletions webapp/src/components/sidebar/sidebarUserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'>
Expand All @@ -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>
Expand Down

0 comments on commit 8a29fff

Please sign in to comment.