Skip to content

Commit

Permalink
Merge pull request #15705 from daraksha-dk/fix-inconsistent-tooltips-…
Browse files Browse the repository at this point in the history
…for-workspace-and-profile-section

add Tooltips at appropriate locations in workspace/user section and update its text
  • Loading branch information
youssef-lr authored Mar 9, 2023
2 parents d717f64 + 7bf161e commit 69af741
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
14 changes: 8 additions & 6 deletions src/pages/settings/InitialSettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class InitialSettingsPage extends React.Component {
<View style={styles.w100}>
<View style={styles.avatarSectionWrapper}>
<Pressable style={[styles.mb3]} onPress={this.openProfileSettings}>
<Tooltip text={this.props.currentUserPersonalDetails.displayName}>
<Tooltip text={this.props.translate('common.profile')}>
<OfflineWithFeedback
pendingAction={lodashGet(this.props.currentUserPersonalDetails, 'pendingFields.avatar', null)}
>
Expand All @@ -273,11 +273,13 @@ class InitialSettingsPage extends React.Component {
</Pressable>

<Pressable style={[styles.mt1, styles.mw100]} onPress={this.openProfileSettings}>
<Text style={[styles.textHeadline]} numberOfLines={1}>
{this.props.currentUserPersonalDetails.displayName
? this.props.currentUserPersonalDetails.displayName
: Str.removeSMSDomain(this.props.session.email)}
</Text>
<Tooltip text={this.props.translate('common.profile')}>
<Text style={[styles.textHeadline]} numberOfLines={1}>
{this.props.currentUserPersonalDetails.displayName
? this.props.currentUserPersonalDetails.displayName
: Str.removeSMSDomain(this.props.session.email)}
</Text>
</Tooltip>
</Pressable>
{this.props.currentUserPersonalDetails.displayName && (
<Text
Expand Down
22 changes: 12 additions & 10 deletions src/pages/workspace/WorkspaceInitialPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,17 @@ class WorkspaceInitialPage extends React.Component {
style={[styles.pRelative, styles.avatarLarge]}
onPress={this.openEditor}
>
<Avatar
containerStyles={styles.avatarLarge}
imageStyles={[styles.avatarLarge, styles.alignSelfCenter]}
source={this.props.policy.avatar ? this.props.policy.avatar : ReportUtils.getDefaultWorkspaceAvatar(policyName)}
fallbackIcon={Expensicons.FallbackWorkspaceAvatar}
size={CONST.AVATAR_SIZE.LARGE}
name={policyName}
type={CONST.ICON_TYPE_WORKSPACE}
/>
<Tooltip text={this.props.translate('workspace.common.settings')}>
<Avatar
containerStyles={styles.avatarLarge}
imageStyles={[styles.avatarLarge, styles.alignSelfCenter]}
source={this.props.policy.avatar ? this.props.policy.avatar : ReportUtils.getDefaultWorkspaceAvatar(policyName)}
fallbackIcon={Expensicons.FallbackWorkspaceAvatar}
size={CONST.AVATAR_SIZE.LARGE}
name={policyName}
type={CONST.ICON_TYPE_WORKSPACE}
/>
</Tooltip>
</Pressable>
{!_.isEmpty(this.props.policy.name) && (
<Pressable
Expand All @@ -212,7 +214,7 @@ class WorkspaceInitialPage extends React.Component {
]}
onPress={this.openEditor}
>
<Tooltip text={this.props.policy.name}>
<Tooltip text={this.props.translate('workspace.common.settings')}>
<Text
numberOfLines={1}
style={[
Expand Down

0 comments on commit 69af741

Please sign in to comment.