hide user name in user dropdown on mobile (#2512)

* hide user name in user dropdown on mobile

* truncate title in header

* prettify code

* Add line height to prevent cutting of lower length letters
This commit is contained in:
André Rusakow
2022-12-26 23:09:52 +01:00
committed by GitHub
parent 7c91099461
commit 53d3a67533
4 changed files with 24 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
@import '../../../styles/mixins.scss';
.root { .root {
button { button {
border: none; border: none;
@@ -7,4 +9,18 @@
} }
} }
} }
.userIcon {
@include screen(desktop) {
margin-right: .5rem;
}
}
.username {
display: none;
@include screen(desktop) {
display: inline;
}
}
} }

View File

@@ -1,4 +1,4 @@
import { Menu, Dropdown, Button, Space } from 'antd'; import { Menu, Dropdown, Button } from 'antd';
import { import {
CaretDownOutlined, CaretDownOutlined,
EditOutlined, EditOutlined,
@@ -83,11 +83,9 @@ export const UserDropdown: FC<UserDropdownProps> = ({ username: defaultUsername
return ( return (
<div id="user-menu" className={`${styles.root}`}> <div id="user-menu" className={`${styles.root}`}>
<Dropdown overlay={menu} trigger={['click']}> <Dropdown overlay={menu} trigger={['click']}>
<Button type="primary" icon={<UserOutlined style={{ marginRight: '.5rem' }} />}> <Button type="primary" icon={<UserOutlined className={styles.userIcon} />}>
<Space> <span className={styles.username}>{username}</span>
{username} <CaretDownOutlined />
<CaretDownOutlined />
</Space>
</Button> </Button>
</Dropdown> </Dropdown>
<Modal <Modal

View File

@@ -33,7 +33,9 @@
font-weight: 600; font-weight: 600;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
max-width: 90%; width: 70vw;
overflow: hidden;
line-height: 1.4;
} }
} }
} }

View File

@@ -23,7 +23,7 @@ export const Header: FC<HeaderComponentProps> = ({
<div id="header-logo" className={styles.logoImage}> <div id="header-logo" className={styles.logoImage}>
<OwncastLogo variant="contrast" /> <OwncastLogo variant="contrast" />
</div> </div>
<h1 className={styles.title} id="global-header-text"> <h1 className={styles.title} id="global-header-text" title={name}>
{name} {name}
</h1> </h1>
</div> </div>