API & Client: add timezone to user - #11

This commit is contained in:
Sam
2018-06-11 15:10:18 +02:00
parent 793ef22c59
commit fe91040370
17 changed files with 98 additions and 4 deletions

View File

@ -208,6 +208,15 @@ input, textarea {
max-width: 45px;
max-height: 45px;
}
.timezone-picker {
padding: 0;
}
.timezone-picker-textfield {
font-size: 15px;
}
.unlink {
color: black;
}

View File

@ -43,6 +43,7 @@ function Profile ({ message, onDeletePicture, onUploadPicture, user }) {
<p>Birth Date: {user.birthDate}</p>
<p>Location: {user.location}</p>
<p>Bio: {user.bio}</p>
<p>Time zone: {user.timezone}</p>
</div>
<div className="col-md-4">
{ user.picture === true && (

View File

@ -1,6 +1,7 @@
import React from 'react'
import { Helmet } from 'react-helmet'
import { connect } from 'react-redux'
import TimezonePicker from 'react-timezone'
import {
initProfileForm,
@ -151,6 +152,27 @@ class ProfileEdit extends React.Component {
/>
</label>
</div>
<div className="form-group">
<label>
Timezone:
<TimezonePicker
className="form-control"
onChange={tz => {
const e = { target:
{
name: 'timezone',
value: tz ? tz : 'Europe/Paris'
}
}
onHandleFormChange(e)
}}
value={formProfile.timezone
? formProfile.timezone
: 'Europe/Paris'
}
/>
</label>
</div>
<input
type="submit"
className="btn btn-primary btn-lg btn-block"