diff --git a/products/ASC.People/Client/src/components/pages/AvatarEditor/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/AvatarEditor/Section/Body/index.js index e2190067a0..65289169a2 100644 --- a/products/ASC.People/Client/src/components/pages/AvatarEditor/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/AvatarEditor/Section/Body/index.js @@ -3,26 +3,73 @@ import { withRouter } from "react-router"; import { connect } from "react-redux"; import styled from 'styled-components'; import { withTranslation } from "react-i18next"; +import { Button } from "asc-web-components"; +import { fetchProfile } from "../../../../../store/profile/actions"; +import { setDocumentTitle } from "../../../../../helpers/utils"; const InfoContainer = styled.div` margin-bottom: 24px; `; -const SectionBodyContent = props => { +class SectionBodyContent extends React.PureComponent{ + constructor(props) { + super(props); + } - const {t} = props + componentDidMount() { + const { match, fetchProfile, t } = this.props; + const { userId } = match.params; - return ( - + setDocumentTitle(t("ProfileAction")); + + if (userId) { + fetchProfile(userId); + } + } + + componentDidUpdate(prevProps) { + const { match, fetchProfile } = this.props; + const { userId } = match.params; + const prevUserId = prevProps.match.params.userId; + + if (userId !== undefined && userId !== prevUserId) { + fetchProfile(userId); + } + } + + onBackClick = () => { + const {profile, settings} = this.props + + debugger + + this.props.history.push(`${settings.homepage}/edit/${profile.userName}`) + } + + render(){ + + const {t, profile} = this.props + + return( + {t("UploadNewPhoto")} - - ); -}; +