Skip to content

Commit f7fd5ad

Browse files
committed
tweaks css, fix location search messages
1 parent c1537c7 commit f7fd5ad

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

config-overrides.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ module.exports = function override (config, env) {
1919
{
2020
loader: 'sass-loader',
2121
options: {
22-
outputStyle: 'compressed'
22+
outputStyle: 'compressed',
23+
includePaths: [path.resolve(__dirname, 'node_modules')],
2324
}
2425
}
2526
]

src/components/contractors/Contractors.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,23 @@ class Contractors extends Component {
119119
render () {
120120
let description = ''
121121
const con_count = this.state.contractor_response && this.state.contractor_response.count
122-
if (con_count && this.state.selected_subject) {
123-
const msg_id_suffix = con_count === 1 ? 'single' : 'plural'
124-
description = this.props.root.get_text('subject_filter_summary_' + msg_id_suffix, {
122+
const location_pretty = (
123+
this.state.contractor_response &&
124+
this.state.contractor_response.location &&
125+
this.state.contractor_response.location.pretty
126+
)
127+
128+
if (con_count) {
129+
const description_prefix = []
130+
if (location_pretty) {
131+
description_prefix.push(location_pretty)
132+
}
133+
if (this.state.selected_subject) {
134+
description_prefix.push(this.state.selected_subject.name)
135+
}
136+
description = this.props.root.get_text('filter_summary_' + (con_count === 1 ? 'single' : 'plural'), {
125137
count: con_count,
126-
subject: this.state.selected_subject.name,
138+
prefix: description_prefix.join('; '),
127139
})
128140
}
129141
const DisplayComponent = this.props.config.mode === 'grid' ? Grid : List
@@ -152,7 +164,9 @@ class Contractors extends Component {
152164
root={this.props.root}/>
153165
<If v={this.state.contractor_response && this.state.contractor_response.count === 0}>
154166
<div className="tcs-no-contractors">
155-
{this.props.root.get_text(this.state.location_str === null ? 'no_tutors_found' : 'no_tutors_found_loc')}
167+
{this.props.root.get_text(
168+
this.state.location_str === null ? 'no_tutors_found' : 'no_tutors_found_loc', {location_pretty}
169+
)}
156170
</div>
157171
</If>
158172

src/components/contractors/Filters.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react'
22
import Select from 'react-select'
3-
import 'react-select/dist/react-select.css'
43
import {If} from '../shared/Tools'
54

65
export const SubjectSelect = ({get_text, show, subjects, selected_subject, subject_change}) => {

src/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ const STRINGS = {
3535
grecaptcha_missing: 'This captcha is required',
3636
required: ' (Required)',
3737
subject_filter_placeholder: 'Select a subject...',
38-
subject_filter_summary_single: '{subject}: showing 1 result',
39-
subject_filter_summary_plural: '{subject}: showing {count} results',
38+
filter_summary_single: '{prefix}: showing 1 result',
39+
filter_summary_plural: '{prefix}: showing {count} results',
4040
location_input_placeholder: 'Enter your address or zip/postal code...',
4141
view_profile: 'View Profile',
4242
review_hours: '({hours} hours)',
4343
previous: 'Previous',
4444
next: 'Next',
4545
no_tutors_found: 'No more tutors found',
46-
no_tutors_found_loc: 'No more tutors found near this location',
46+
no_tutors_found_loc: 'No more tutors found near "{location_pretty}"',
4747
distance_away: '{distance}km away',
4848
}
4949

src/styles/contractor-filters.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@import './vue-multiselect/dist/vue-multiselect.min';
1+
@import 'react-select/dist/react-select.min';
22
@import '../conf';
33

44
.multiselect__select {
@@ -41,6 +41,7 @@
4141
padding: 8px;
4242
font-size: 16px;
4343
outline: none !important;
44+
line-height: 1;
4445
&::placeholder {
4546
color: #aaa;
4647
}

0 commit comments

Comments
 (0)