Skip to content

Commit

Permalink
fix(SecondaryNavigation): text ellipsis
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Feb 28, 2019
1 parent 10c967d commit c64888a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import React from 'react';

import { Text } from '../Text';
import { Dropdown } from '../Dropdown';
import { Menu } from '../Menu';
import { Icon } from '../Icon';
Expand Down Expand Up @@ -68,7 +67,7 @@ class SecondaryNavigationItem extends React.PureComponent<SecondaryNavigationIte

return (
<SecondaryNavigationItemTag { ...rest } hovered={ hovered } onMouseLeave={ this.onMouseLeave } onMouseEnter={ this.onMouseEnter } >
<SecondaryNavigationItemLabelTag tagName={ Text } modifiers={ rest } >
<SecondaryNavigationItemLabelTag tagName="span" modifiers={ rest } >
{ label }
</SecondaryNavigationItemLabelTag>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const [SecondaryNavigationItemTag, rootTheme] = createThemeTag(name, ({ COLORS }
paddingLeft: 4,
paddingRight: 20,
justifyContent: 'space-between',
alignItems: 'center',

[`&.active ${SecondaryNavigationItemActionsTag}`]: {
visibility: 'visible',
Expand All @@ -36,13 +37,18 @@ const [SecondaryNavigationItemTag, rootTheme] = createThemeTag(name, ({ COLORS }
},
}));

const [SecondaryNavigationItemLabelTag, labelTheme] = createThemeTag(`${name}Label`, () => ({
const [SecondaryNavigationItemLabelTag, labelTheme] = createThemeTag(`${name}Label`, ({ COLORS, SIZES }: *) => ({
root: {
display: 'flex',
alignItems: 'center',
paddingLeft: '20px',
backgroundColor: 'inherit',
opacity: '0.9',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
minWidth: 0,
marginRight: 8,
color: COLORS.PRIMARY_TEXT_COLOR,
fontSize: SIZES.BODY_TEXT,
},
}));

Expand All @@ -61,7 +67,6 @@ const theme = {
...actionsTheme,
};


export {
theme,
SecondaryNavigationItemTag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`<SecondaryNavigation /> should shallow SecondaryNavigation item 1`] = `
>
<Boost(secondaryNavigationItemLabel)
modifiers={Object {}}
tagName={[Function]}
tagName="span"
>
First item
</Boost(secondaryNavigationItemLabel)>
Expand Down

0 comments on commit c64888a

Please sign in to comment.