Style the unread message as a badge

master
Torjus 2018-07-12 17:39:53 +02:00
parent 8d9436a10e
commit 9af194769b
2 changed files with 18 additions and 2 deletions

View File

@ -35,7 +35,11 @@ class ToolArea extends React.Component
checked={currentToolTab === 'chat'}
/>
<label htmlFor='tab-chat'>
Chat ({unread} new)
Chat
{unread > 0 && (
<span className='badge'>{unread}</span>
)}
</label>
<div className='tab'>

View File

@ -63,7 +63,7 @@
> label {
order: 1;
display: block;
padding: 1vmin 0 1vmin 0;
padding: 1vmin 0 0.8vmin 0;
cursor: pointer;
background: rgba(#000, 0.3);
font-weight: bold;
@ -72,6 +72,18 @@
width: 33.33%;
font-size: 1.3vmin;
height: 3vmin;
> .badge {
padding: 0.1vmin 1vmin;
text-align: center;
font-weight: 300;
font-size: 1.2vmin;
color: #fff;
background-color: #b12525;
border-radius: 2px;
margin-left: 1vmin;
}
}
> .tab {