fix(netlify-cms-core): remove double focusable elements on profile menu button (#1900)
This commit is contained in:
parent
fe6af1986f
commit
888ae6b053
@ -12,8 +12,8 @@ const styles = {
|
|||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
|
|
||||||
const AppHeaderAvatar = styled.button`
|
const AvatarDropdownButton = styled(DropdownButton)`
|
||||||
border: 0;
|
display: inline-block;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: #1e2532;
|
color: #1e2532;
|
||||||
@ -38,11 +38,8 @@ const AppHeaderSiteLink = styled.a`
|
|||||||
padding: 10px 16px;
|
padding: 10px 16px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Avatar = ({ imageUrl }) => (
|
const Avatar = ({ imageUrl }) =>
|
||||||
<AppHeaderAvatar>
|
imageUrl ? <AvatarImage src={imageUrl} /> : <AvatarPlaceholderIcon type="user" size="large" />;
|
||||||
{imageUrl ? <AvatarImage src={imageUrl} /> : <AvatarPlaceholderIcon type="user" size="large" />}
|
|
||||||
</AppHeaderAvatar>
|
|
||||||
);
|
|
||||||
|
|
||||||
Avatar.propTypes = {
|
Avatar.propTypes = {
|
||||||
imageUrl: PropTypes.string,
|
imageUrl: PropTypes.string,
|
||||||
@ -60,9 +57,9 @@ const SettingsDropdown = ({ displayUrl, imageUrl, onLogoutClick, t }) => (
|
|||||||
dropdownWidth="100px"
|
dropdownWidth="100px"
|
||||||
dropdownPosition="right"
|
dropdownPosition="right"
|
||||||
renderButton={() => (
|
renderButton={() => (
|
||||||
<DropdownButton>
|
<AvatarDropdownButton>
|
||||||
<Avatar imageUrl={imageUrl} />
|
<Avatar imageUrl={imageUrl} />
|
||||||
</DropdownButton>
|
</AvatarDropdownButton>
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<DropdownItem label={t('ui.settingsDropdown.logOut')} onClick={onLogoutClick} />
|
<DropdownItem label={t('ui.settingsDropdown.logOut')} onClick={onLogoutClick} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user