gab-social/app/javascript/gabsocial/components/modal/edit_profile_modal.js

88 lines
2.3 KiB
JavaScript
Raw Normal View History

2020-03-27 22:57:03 +00:00
import { defineMessages, injectIntl } from 'react-intl'
import ImmutablePureComponent from 'react-immutable-pure-component'
2020-04-24 04:17:27 +01:00
import ImmutablePropTypes from 'react-immutable-proptypes'
import { me } from '../../initial_state'
import ModalLayout from './modal_layout'
import Avatar from '../avatar'
2020-03-27 22:57:03 +00:00
import Button from '../button'
2020-04-24 04:17:27 +01:00
import Divider from '../divider'
import Image from '../image'
import Input from '../input'
2020-03-27 22:57:03 +00:00
import Text from '../text'
2020-04-24 04:17:27 +01:00
import Textarea from '../textarea'
2020-03-27 22:57:03 +00:00
const messages = defineMessages({
2020-04-24 04:17:27 +01:00
edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
headerPhoto: { id: 'header_photo', defaultMessage: 'Header photo' },
})
2020-03-27 22:57:03 +00:00
2020-04-24 04:17:27 +01:00
const mapStateToProps = (state) => ({
account: state.getIn(['accounts', me]),
2020-03-27 22:57:03 +00:00
})
export default
@injectIntl
2020-04-24 04:17:27 +01:00
@connect(mapStateToProps)
2020-03-27 22:57:03 +00:00
class EditProfileModal extends ImmutablePureComponent {
static propTypes = {
2020-04-24 04:17:27 +01:00
account: ImmutablePropTypes.map,
2020-03-27 22:57:03 +00:00
intl: PropTypes.object.isRequired,
}
render() {
2020-04-24 04:17:27 +01:00
const { account, intl } = this.props
const headerSrc = !!account ? account.get('header') : ''
2020-03-27 22:57:03 +00:00
return (
2020-04-24 04:17:27 +01:00
<ModalLayout
title={intl.formatMessage(messages.edit_profile)}
noPadding
width={460}
>
<div className={[_s.default, _s.py5, _s.px5, _s.width100PC, _s.overflowHidden].join(' ')}>
<Image
alt={intl.formatMessage(messages.headerPhoto)}
className={_s.radiusSmall}
height='180px'
src={headerSrc}
/>
</div>
<div className={[_s.default, _s.flexRow, _s.pl25].join(' ')}>
<div className={[_s.default, _s.circle, _s.mtNeg75PX, _s.boxShadowProfileAvatar].join(' ')}>
<Avatar
size={98}
account={account}
noHover
/>
</div>
</div>
<div className={[_s.default, _s.px15, _s.py15].join(' ')}>
<Input
title='Name'
value=''
disabled={false}
// onChange={this.handleTitleChange}
placeholder='Add your name...'
/>
<Divider isInvisible />
<Textarea
title='Bio'
value=''
disabled={false}
// onChange={this.handleDescriptionChange}
placeholder='Add your bio...'
/>
</div>
2020-03-27 22:57:03 +00:00
</ModalLayout>
)
}
}