#116: improve userbar layout for small screens and long nicknames

This commit is contained in:
SleepWalker 2016-06-05 14:00:43 +03:00
parent e0ab116a9a
commit 446bfbaa29
5 changed files with 15 additions and 8 deletions

View File

@ -1,15 +1,14 @@
.group {
position: relative; // это нужно только чтобы postcss не удалял пустой класс и composes мог его схавать
}
.horizontalGroup { .horizontalGroup {
composes: group; display: flex;
} }
.item { .item {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
$borderConfig: 1px solid rgba(#fff, 0.15); $borderConfig: 1px solid rgba(#fff, 0.15);
float: left;
border-left: $borderConfig; border-left: $borderConfig;
&:last-child { &:last-child {

View File

@ -27,7 +27,7 @@ export default class LoggedInPanel extends Component {
const { user } = this.props; const { user } = this.props;
return ( return (
<div className={buttonGroups.horizontalGroup}> <div className={classNames(buttonGroups.horizontalGroup, styles.loggedInPanel)}>
<Link to="/" className={classNames(buttons.green, buttonGroups.item)}> <Link to="/" className={classNames(buttons.green, buttonGroups.item)}>
<span className={styles.userIcon} /> <span className={styles.userIcon} />
<span className={styles.userName}>{user.username}</span> <span className={styles.userName}>{user.username}</span>

View File

@ -1,3 +1,6 @@
.loggedInPanel {
justify-content: flex-end;
}
.userIcon { .userIcon {
composes: user from 'components/ui/icons.scss'; composes: user from 'components/ui/icons.scss';

View File

@ -1,2 +1,3 @@
.userbar { .userbar {
text-align: right;
} }

View File

@ -36,6 +36,7 @@ $userBarHeight: 50px;
.headerContent { .headerContent {
composes: wrapper; composes: wrapper;
position: relative;
} }
.logo { .logo {
@ -65,5 +66,8 @@ $userBarHeight: 50px;
} }
.userbar { .userbar {
float: right; position: absolute;
right: 0;
left: 115px;
top: 0;
} }