Skip to content

Commit e9880f0

Browse files
committed
location search display
1 parent 6d3dd0d commit e9880f0

File tree

9 files changed

+21
-9
lines changed

9 files changed

+21
-9
lines changed

src/components/contractors/Contractors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class Contractors extends Component {
152152
root={this.props.root}/>
153153
<If v={this.state.contractor_response && this.state.contractor_response.count === 0}>
154154
<div className="tcs-no-contractors">
155-
{this.props.root.get_text('no_tutors_found')}
155+
{this.props.root.get_text(this.state.location_str === null ? 'no_tutors_found' : 'no_tutors_found_loc')}
156156
</div>
157157
</If>
158158

src/components/contractors/List.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react'
22
import {Link} from 'react-router-dom'
3-
import {Location, Markdown} from '../shared/Tools'
3+
import {Location, Markdown, If} from '../shared/Tools'
44
import Stars from './Stars'
55

66
class AnimateLink extends Component {
@@ -64,6 +64,11 @@ export const List = ({contractors, root}) => (
6464
<div className="tcs-location">
6565
<Location/>
6666
<span>{contractor.town}</span>
67+
<div className="tcs-distance">
68+
<If v={contractor.distance !== null}>
69+
{root.get_text('distance_away', {distance: Math.round(contractor.distance / 100) / 10})}
70+
</If>
71+
</div>
6772
</div>
6873
</div>
6974
</AnimateLink>

src/conf.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ $size-sm: 768px;
1818
$button-colour: $highlight;
1919
// size used for images in grid and list view
2020
$dft-image-size: 150px;
21+
$grey-text: #888;

src/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ const STRINGS = {
3434
enquiry_title: 'Enquiry',
3535
grecaptcha_missing: 'This captcha is required',
3636
required: ' (Required)',
37-
subject_filter_placeholder: 'Select a Subject...',
37+
subject_filter_placeholder: 'Select a subject...',
3838
subject_filter_summary_single: '{subject}: showing 1 result',
3939
subject_filter_summary_plural: '{subject}: showing {count} results',
40-
location_input_placeholder: 'Enter your Address or Postal code...',
40+
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',
47+
distance_away: '{distance}km away',
4648
}
4749

4850
const MODES = ['grid', 'list', 'enquiry', 'enquiry-modal']

src/styles/contractors.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $pagination-radius: 4px;
6565
}
6666
.tcs-disable {
6767
pointer-events: none;
68-
color: #888;
68+
color: $grey-text;
6969
}
7070
}
7171

src/styles/input.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $border-radius: 5px;
4040
}
4141
.help-text {
4242
font-size: 14px;
43-
color: #888;
43+
color: $grey-text;
4444
&.muted {
4545
display: none;
4646
}

src/styles/list.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $box-height: 186px;
2727
font-size: 26px;
2828
}
2929
.tcs-primary-description {
30-
color: #888;
30+
color: $grey-text;
3131
overflow: hidden;
3232
text-overflow: ellipsis;
3333
display: grid;
@@ -55,6 +55,10 @@ $box-height: 186px;
5555
}
5656
}
5757

58+
.tcs-distance {
59+
text-align: center;
60+
}
61+
5862
@media(max-width: 600px) {
5963
.tcs-list {
6064
.tcs-item {

src/styles/stars.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
margin-top: 2px;
99
display: inline-block;
1010
padding: 3px 6px;
11-
color: #888;
11+
color: $grey-text;
1212
}
1313
}
1414

src/styles/tools.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ svg.tcs-close {
6868
padding: 5px;
6969
box-sizing: content-box;
7070
path {
71-
fill: #888;
71+
fill: $grey-text;
7272
transition: all .5s ease;
7373
}
7474
&:hover {

0 commit comments

Comments
 (0)