mirror of https://github.com/vector-im/riot-web
				
				
				
			Revert to avatar only when custom status disabled
This returns to the previous behavior of avatar only without a button when the custom status feature is disabled so that you don't get pointer cursor for something that does nothing when clicked. The avatar ring spacing is kept consistent with and without the feature enabled by using a different class in CSS.pull/21833/head
							parent
							
								
									632bbde598
								
							
						
					
					
						commit
						4b13774585
					
				| 
						 | 
				
			
			@ -14,13 +14,13 @@ See the License for the specific language governing permissions and
 | 
			
		|||
limitations under the License.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
.mx_MemberStatusMessageAvatar .mx_BaseAvatar {
 | 
			
		||||
.mx_MessageComposer_avatar .mx_BaseAvatar {
 | 
			
		||||
    padding: 1.5px;
 | 
			
		||||
    border: 1.2px solid transparent;
 | 
			
		||||
    border-radius: 14px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.mx_MemberStatusMessageAvatar .mx_BaseAvatar_initial {
 | 
			
		||||
.mx_MessageComposer_avatar .mx_BaseAvatar_initial {
 | 
			
		||||
    left: 1.5px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -108,27 +108,26 @@ export default class MemberStatusMessageAvatar extends React.Component {
 | 
			
		|||
    };
 | 
			
		||||
 | 
			
		||||
    render() {
 | 
			
		||||
        const customStatusFeatureEnabled =
 | 
			
		||||
            SettingsStore.isFeatureEnabled("feature_custom_status");
 | 
			
		||||
        const avatar = <MemberAvatar
 | 
			
		||||
            member={this.props.member}
 | 
			
		||||
            width={this.props.width}
 | 
			
		||||
            height={this.props.height}
 | 
			
		||||
            resizeMethod={this.props.resizeMethod}
 | 
			
		||||
        />;
 | 
			
		||||
 | 
			
		||||
        let onClick = null;
 | 
			
		||||
        let hasStatus = false;
 | 
			
		||||
 | 
			
		||||
        if (customStatusFeatureEnabled) {
 | 
			
		||||
            onClick = this._onClick;
 | 
			
		||||
            hasStatus = this.state.hasStatus;
 | 
			
		||||
        if (!SettingsStore.isFeatureEnabled("feature_custom_status")) {
 | 
			
		||||
            return avatar;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const classes = classNames({
 | 
			
		||||
            "mx_MemberStatusMessageAvatar": true,
 | 
			
		||||
            "mx_MemberStatusMessageAvatar_hasStatus": hasStatus,
 | 
			
		||||
            "mx_MemberStatusMessageAvatar_hasStatus": this.state.hasStatus,
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        return <AccessibleButton onClick={onClick} className={classes} element="div">
 | 
			
		||||
            <MemberAvatar member={this.props.member}
 | 
			
		||||
                          width={this.props.width}
 | 
			
		||||
                          height={this.props.height}
 | 
			
		||||
                          resizeMethod={this.props.resizeMethod} />
 | 
			
		||||
        return <AccessibleButton className={classes}
 | 
			
		||||
            element="div" onClick={this._onClick}
 | 
			
		||||
        >
 | 
			
		||||
            {avatar}
 | 
			
		||||
        </AccessibleButton>;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue