Wrangle CSS to get avatar in right place

This commit is contained in:
Kegan Dougal 2015-12-24 09:20:16 +00:00
parent 05d1d7c82d
commit 5286ec170f
2 changed files with 8 additions and 6 deletions

View file

@ -198,7 +198,7 @@ module.exports = React.createClass({
<div className="mx_UserSettings_avatarPicker"> <div className="mx_UserSettings_avatarPicker">
<ChangeAvatar ref="changeAvatar" initialAvatarUrl={avatarUrl} <ChangeAvatar ref="changeAvatar" initialAvatarUrl={avatarUrl}
showUploadSection={false} /> showUploadSection={false} className="mx_UserSettings_avatarPicker_img"/>
<div className="mx_UserSettings_avatarPicker_edit"> <div className="mx_UserSettings_avatarPicker_edit">
<label htmlFor="avatarInput"> <label htmlFor="avatarInput">
<img src="img/upload.svg" <img src="img/upload.svg"
@ -214,7 +214,7 @@ module.exports = React.createClass({
<div className="mx_UserSettings_section"> <div className="mx_UserSettings_section">
<ChangePassword <ChangePassword
className="mx_UserSettings_profileTable" className="mx_UserSettings_accountTable"
rowClassName="mx_UserSettings_profileTableRow" rowClassName="mx_UserSettings_profileTableRow"
rowLabelClassName="mx_UserSettings_profileLabelCell" rowLabelClassName="mx_UserSettings_profileLabelCell"
rowInputClassName="mx_UserSettings_profileInputCell" rowInputClassName="mx_UserSettings_profileInputCell"

View file

@ -24,7 +24,8 @@ module.exports = React.createClass({
initialAvatarUrl: React.PropTypes.string, initialAvatarUrl: React.PropTypes.string,
room: React.PropTypes.object, room: React.PropTypes.object,
// if false, you need to call changeAvatar.onFileSelected yourself. // if false, you need to call changeAvatar.onFileSelected yourself.
showUploadSection: React.PropTypes.bool showUploadSection: React.PropTypes.bool,
className: React.PropTypes.string
}, },
Phases: { Phases: {
@ -35,7 +36,8 @@ module.exports = React.createClass({
getDefaultProps: function() { getDefaultProps: function() {
return { return {
showUploadSection: true showUploadSection: true,
className: "mx_Dialog_content" // FIXME - shouldn't be this by default
}; };
}, },
@ -121,7 +123,7 @@ module.exports = React.createClass({
var uploadSection; var uploadSection;
if (this.props.showUploadSection) { if (this.props.showUploadSection) {
uploadSection = ( uploadSection = (
<div className="mx_Dialog_content"> <div className={this.props.className}>
Upload new: Upload new:
<input type="file" onChange={this.onFileSelected}/> <input type="file" onChange={this.onFileSelected}/>
{this.state.errorText} {this.state.errorText}
@ -134,7 +136,7 @@ module.exports = React.createClass({
case this.Phases.Error: case this.Phases.Error:
return ( return (
<div> <div>
<div className="mx_Dialog_content"> <div className={this.props.className}>
{avatarImg} {avatarImg}
</div> </div>
{uploadSection} {uploadSection}