Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim long workspace name #4835

Merged
merged 2 commits into from
Aug 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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