From 59088a1687b999e40d7468ad27997d2ec78a294e Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Mon, 19 Jun 2017 19:46:15 +0200 Subject: [PLT-6452] Remove edit button on mobile, and have the edit icon beside the value, and the value as a link (#6565) * Remove edit button on mobile, and have the edit icon beside the value, and the value as a link * update per review --- webapp/components/setting_item_min.jsx | 33 +++++++++++++++++----- .../user_settings_general.jsx | 31 ++++++++++++++++++++ 2 files changed, 57 insertions(+), 7 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/setting_item_min.jsx b/webapp/components/setting_item_min.jsx index f230f0198..b7752056d 100644 --- a/webapp/components/setting_item_min.jsx +++ b/webapp/components/setting_item_min.jsx @@ -10,7 +10,22 @@ import React from 'react'; export default function SettingItemMin(props) { let editButton = null; - if (!props.disableOpen) { + let describeSection = null; + if (!props.disableOpen && Utils.isMobile()) { + editButton = ( +
  • + + + {props.describe} + +
  • + ); + } else if (!props.disableOpen) { editButton = (
  • ); + + describeSection = ( +
  • + {props.describe} +
  • + ); } return ( @@ -36,12 +60,7 @@ export default function SettingItemMin(props) { >
  • {props.title}
  • {editButton} -
  • - {props.describe} -
  • + {describeSection} ); } diff --git a/webapp/components/user_settings/user_settings_general/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general/user_settings_general.jsx index e265754d9..8aeafd60a 100644 --- a/webapp/components/user_settings/user_settings_general/user_settings_general.jsx +++ b/webapp/components/user_settings/user_settings_general/user_settings_general.jsx @@ -50,6 +50,10 @@ const holders = defineMessages({ id: 'user.settings.general.uploadImage', defaultMessage: "Click 'Edit' to upload an image." }, + uploadImageMobile: { + id: 'user.settings.general.mobile.uploadImage', + defaultMessage: 'Click to upload an image.' + }, fullName: { id: 'user.settings.general.fullName', defaultMessage: 'Full Name' @@ -822,6 +826,14 @@ class UserSettingsGeneralTab extends React.Component { defaultMessage="Click 'Edit' to add your full name" /> ); + if (Utils.isMobile()) { + describe = ( + + ); + } } nameSection = ( @@ -916,6 +928,14 @@ class UserSettingsGeneralTab extends React.Component { defaultMessage="Click 'Edit' to add a nickname" /> ); + if (Utils.isMobile()) { + describe = ( + + ); + } } nicknameSection = ( @@ -1092,6 +1112,14 @@ class UserSettingsGeneralTab extends React.Component { defaultMessage="Click 'Edit' to add your job title / position" /> ); + if (Utils.isMobile()) { + describe = ( + + ); + } } positionSection = ( @@ -1128,6 +1156,9 @@ class UserSettingsGeneralTab extends React.Component { ); } else { let minMessage = formatMessage(holders.uploadImage); + if (Utils.isMobile()) { + minMessage = formatMessage(holders.uploadImageMobile); + } if (user.last_picture_update) { minMessage = (