Commit e64bd600 authored by MrMan's avatar MrMan

Merge branch 'topic-29-fix-max-age' into 'master'

Resolves #29, Fix max age setting in preferences

Fix the max age setting in preferences, was setting min before. Also added some text for specifying sex to make it clearer, and made the save and reset changes button at the bottom similar to recs page

See merge request !2
parents 543968af 0a23fd23
Pipeline #2498032 skipped
......@@ -112,6 +112,7 @@ class PreferencesPage extends React.Component {
let genderFilter = _.get(this.state, "prefs.gender");
let genderIsMale = genderFilter === Constants.TINDER_GENDER_MALE;
let genderIsFemale = genderFilter === Constants.TINDER_GENDER_FEMALE;
let genderName = genderIsMale ? this.i18n`general.firstCapitalizedMale` : this.i18n`general.firstCapitalizedFemale`;
// Request user to build prefs if not provided yet
if (_.isNull(this.state.prefs)) {
......@@ -141,6 +142,7 @@ class PreferencesPage extends React.Component {
<CollapsibleLabeledFormSection labelFor="gender"
labelText={this.i18n`pages.preferences.genderSectionHeading`}>
<div className="pure-g">
<div className="pure-u-1-3">
<div className="two-button-options">
<button type="button"
......@@ -158,6 +160,8 @@ class PreferencesPage extends React.Component {
</button>
</div>
</div>
<span className=" xlarge pure-u-2-3">{genderName}</span>
</div>
</CollapsibleLabeledFormSection>
......@@ -178,7 +182,7 @@ class PreferencesPage extends React.Component {
<div className="pure-u-1-3 center-aligned-text">
<select id="age-filter-max"
className="full-width center-aligned-text"
onChange={this.updateAgeFilterMin.bind(this)}
onChange={this.updateAgeFilterMax.bind(this)}
value={this.state.prefs.age_filter_max}>
{ageOptions}
</select>
......@@ -192,6 +196,7 @@ class PreferencesPage extends React.Component {
<div className="pure-u-1-2">
<input id="distance-filter"
type="number"
className="full-width"
onChange={this.updateDistanceFilter.bind(this)}
value={this.state.prefs.distance_filter}/>
</div>
......@@ -225,20 +230,25 @@ class PreferencesPage extends React.Component {
</div>
</div>
<div className="pure-g">
<div className="pure-u-1">
<button type="submit"
className="pure-button button-success"
onClick={this.updatePreferences.bind(this)}>
<i className="fa fa-save"></i> {this.i18n`pages.preferences.updatePreferences`}
</button>
<br/>
<button type="button"
onClick={this.resetPreferences.bind(this)}
className="pure-button">
<i className="fa fa-refresh"></i> {this.i18n`pages.preferences.undoChanges`}
</button>
<div className="abs pinned-to-bottom full-width">
<div className="pure-g">
<div className="pure-u-1-2">
<button type="submit"
className="pure-button button-success full-width squared"
onClick={this.updatePreferences.bind(this)}>
<i className="fa fa-save"></i> {this.i18n`pages.preferences.updatePreferences`}
</button>
</div>
<div className="pure-u-1-2">
<button type="button"
className="pure-button full-width squared"
onClick={this.resetPreferences.bind(this)}>
<i className="fa fa-trash"></i> {this.i18n`pages.preferences.undoChanges`}
</button>
</div>
</div>
</div>
......
......@@ -7,6 +7,12 @@ export default {
last: "human warmth"
}
},
general: {
male: "male",
female: "female",
firstCapitalizedMale: "Male",
firstCapitalizedFemale: "Female"
},
nav: {
loadingMessage: "Loading...",
back: "Back",
......@@ -34,8 +40,8 @@ export default {
locationSectionHeading: "Location",
fromGPS: "From GPS",
customLocation: "Custom Location",
updatePreferences: "Update Preferences",
undoChanges: "Undo all changes",
updatePreferences: "Update",
undoChanges: "Reset changes",
inbetweenAges: "to"
},
login: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment