Skip to content

Commit

Permalink
Merge pull request #4835 from akshayasalvi/trim-long-workspace-name
Browse files Browse the repository at this point in the history
Trim long workspace name
  • Loading branch information
aldo-expensify authored Aug 25, 2021
2 parents 835cfde + 7117ce8 commit 2efff1b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
12 changes: 7 additions & 5 deletions src/components/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,13 @@ const MenuItem = ({
</View>
)}
<View style={[styles.justifyContentCenter, styles.menuItemTextContainer]}>
<Text style={[
styles.popoverMenuText,
styles.ml3,
(disabled ? styles.disabledText : undefined),
]}
<Text
style={[
styles.popoverMenuText,
styles.ml3,
(disabled ? styles.disabledText : undefined),
]}
numberOfLines={1}
>
{title}
</Text>
Expand Down
20 changes: 12 additions & 8 deletions src/pages/workspace/WorkspaceSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import ONYXKEYS from '../../ONYXKEYS';
import Avatar from '../../components/Avatar';
import CONST from '../../CONST';
import {create} from '../../libs/actions/Policy';
import Tooltip from '../../components/Tooltip';

const propTypes = {
/** Policy for the current route */
Expand Down Expand Up @@ -134,17 +135,20 @@ const WorkspaceSidebar = ({
styles.alignSelfCenter,
styles.mt4,
styles.mb6,
styles.w100,
]}
onPress={openEditor}
>
<Text
numberOfLines={1}
style={[
styles.displayName,
]}
>
{policy.name}
</Text>
<Tooltip text={policy.name}>
<Text
numberOfLines={1}
style={[
styles.displayName,
]}
>
{policy.name}
</Text>
</Tooltip>
</Pressable>
</View>
</View>
Expand Down
1 change: 1 addition & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ const styles = {
fontSize: variables.fontSizeNormal,
fontWeight: fontWeightBold,
color: themeColors.heading,
maxWidth: 240,
},

menuItemTextContainer: {
Expand Down

0 comments on commit 2efff1b

Please sign in to comment.