diff --git a/package.json b/package.json
index 550513c..27c1cbe 100644
--- a/package.json
+++ b/package.json
@@ -33,6 +33,7 @@
"lodash": "^4.17.4",
"material-ui": "^1.0.0-beta.34",
"material-ui-icons": "^1.0.0-beta.17",
+ "material-ui-pickers": "^1.0.0-beta.15.1",
"moment": "^2.18.1",
"morgan": "^1.8.1",
"node-sass-chokidar": "0.0.3",
diff --git a/public/index.html b/public/index.html
index 9d705e0..bf397a4 100644
--- a/public/index.html
+++ b/public/index.html
@@ -106,7 +106,7 @@
padding: 0.01em 16px;
}
-
+
diff --git a/src/actions/userActions.ts b/src/actions/userActions.ts
index 6ab3075..8ac7b66 100644
--- a/src/actions/userActions.ts
+++ b/src/actions/userActions.ts
@@ -34,7 +34,11 @@ export const dbGetUserInfo = () => {
fullName: userProfile.fullName,
banner: userProfile.banner,
tagLine: userProfile.tagLine,
- creationDate: userProfile.creationDate
+ creationDate: userProfile.creationDate,
+ birthday: userProfile.birthday,
+ companyName: userProfile.companyName,
+ webUrl: userProfile.webUrl,
+ twitterId: userProfile.twitterId,
}))
})
.catch((error: SocialError) => dispatch(globalActions.showMessage(error.message)))
@@ -63,7 +67,11 @@ export const dbGetUserInfoByUserId = (uid: string, callerKey: string) => {
fullName: userProfile.fullName,
banner: userProfile.banner,
tagLine: userProfile.tagLine,
- creationDate: userProfile.creationDate
+ creationDate: userProfile.creationDate,
+ birthday: userProfile.birthday,
+ companyName: userProfile.companyName,
+ webUrl: userProfile.webUrl,
+ twitterId: userProfile.twitterId,
}))
switch (callerKey) {
@@ -87,7 +95,7 @@ export const dbGetUserInfoByUserId = (uid: string, callerKey: string) => {
*/
export const dbUpdateUserInfo = (newProfile: Profile) => {
return (dispatch: any, getState: Function) => {
-
+ console.trace('newProfile', newProfile)
// Get current user id
let uid: string = getState().authorize.uid
@@ -98,6 +106,10 @@ export const dbUpdateUserInfo = (newProfile: Profile) => {
email: newProfile.email || profile.email || '',
fullName: newProfile.fullName || profile.fullName || '',
tagLine: newProfile.tagLine || profile.tagLine || '',
+ birthday: newProfile.birthday,
+ companyName: newProfile.companyName || '',
+ webUrl: newProfile.webUrl || '',
+ twitterId: newProfile.twitterId || '',
creationDate: newProfile.creationDate
}
return userService.updateUserProfile(uid,updatedProfile).then(() => {
diff --git a/src/components/editProfile/EditProfileComponent.tsx b/src/components/editProfile/EditProfileComponent.tsx
index 01fbf7c..243f309 100644
--- a/src/components/editProfile/EditProfileComponent.tsx
+++ b/src/components/editProfile/EditProfileComponent.tsx
@@ -3,6 +3,7 @@ import React, { Component } from 'react'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import { getTranslate, getActiveLanguage } from 'react-localize-redux'
+import moment from 'moment/moment'
import { grey } from 'material-ui/colors'
import IconButton from 'material-ui/IconButton'
@@ -25,6 +26,7 @@ import TextField from 'material-ui/TextField'
import Input, { InputLabel } from 'material-ui/Input'
import { FormControl, FormHelperText } from 'material-ui/Form'
import { withStyles } from 'material-ui/styles'
+import { TimePicker, DatePicker, DateTimePicker } from 'material-ui-pickers'
// - Import app components
import ImgCover from 'components/imgCover'
@@ -72,11 +74,19 @@ const styles = (theme: any) => ({
width: '100%'
}
},
- bottomSpace: {
+ bottomPaperSpace: {
height: 16,
[theme.breakpoints.down('xs')]: {
height: 90
}
+ },
+ box: {
+ padding: '0px 24px 0px',
+ display: 'flex'
+
+ },
+ bottomTextSpace: {
+ marginBottom: 15
}
})
@@ -130,11 +140,6 @@ export class EditProfileComponent extends Component {
- const { fullNameInput, tagLineInput, avatar, banner } = this.state
+ const { fullNameInput, tagLineInput, avatar, banner, selectedBirthday, companyName, webUrl, twitterId} = this.state
+ const {info} = this.props
if (this.state.fullNameInput.trim() === '') {
this.setState({
@@ -274,7 +300,11 @@ export class EditProfileComponent extends Component 0 ? selectedBirthday : ((info && info.birthday) ? info!.birthday! : 0)
})
}
}
@@ -313,6 +343,14 @@ export class EditProfileComponent extends Component {
+ console.trace('changed', date)
+ this.setState({ selectedBirthday: date.unix() })
+ }
+
componentDidMount() {
this.handleResize(null)
}
@@ -324,6 +362,7 @@ export class EditProfileComponent extends Component
@@ -385,31 +424,70 @@ export class EditProfileComponent extends Component
{translate!('profile.personalInformationLabel')}
-
-
+
+
{translate!('profile.fullName')}
+ value={this.state.fullNameInput}
+ />
{this.state.fullNameInputError}
-
-
-
+
+
{translate!('profile.tagline')}
+ value={this.state.tagLineInput}
+ />
{this.state.fullNameInputError}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/components/editProfile/IEditProfileComponentState.ts b/src/components/editProfile/IEditProfileComponentState.ts
index 154dc4d..b477878 100644
--- a/src/components/editProfile/IEditProfileComponentState.ts
+++ b/src/components/editProfile/IEditProfileComponentState.ts
@@ -65,4 +65,29 @@ export interface IEditProfileComponentState {
*/
openAvatar: boolean
+ /**
+ * Default birth day
+ */
+ defaultBirthday: Date
+
+ /**
+ * Seleted birth day
+ */
+ selectedBirthday: number
+
+ /**
+ * Web URL
+ */
+ webUrl: string
+
+ /**
+ * User company name
+ */
+ companyName: string
+
+ /**
+ * User twitter id
+ */
+ twitterId: string
+
}
diff --git a/src/components/shareDialog/ShareDialogComponent.tsx b/src/components/shareDialog/ShareDialogComponent.tsx
index 6573d5b..e34f9b8 100644
--- a/src/components/shareDialog/ShareDialogComponent.tsx
+++ b/src/components/shareDialog/ShareDialogComponent.tsx
@@ -105,7 +105,7 @@ export class ShareDialogComponent extends Component