Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add button to i18n #1120

Merged
merged 2 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions imports/both/i18n/en/phm/home.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
{
"first_title": "Local Action for Global Change",
"find_events": "Find the #PublicHappinessMovement near me!",
"first_section": {
"form": {
"global_search": {
"text_input": {
"placeholder": "Search for events, organizations, or people"
},
"button": {
"text": "GLOBAL"
}
},
"local_search": {
"text_input": {
"placeholder": "Search for events, organizations, or people"
},
"button": {
"text": "LOCAL"
}
}
}
},
"post": {
"first_title": "Create a Public Happiness Gathering",
"button": "Sign Up and Begin!",
Expand Down
22 changes: 10 additions & 12 deletions imports/client/ui/pages/Home/FirstSection/Find/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { geocodeByAddress, getLatLng } from 'react-places-autocomplete'
import getUserPosition, { getCurrentLocation, storeUserLocation } from '/imports/client/utils/location/getUserPosition'
import i18n from '/imports/both/i18n/en'

const FirstI18N = i18n.Home.first_section

class Find extends Component {
state = {
error: null,
Expand All @@ -29,6 +31,9 @@ class Find extends Component {
search
} = this.state

const {
form
} = FirstI18N
if (userLocation) {
window.previousStateOfMap = undefined
return <Redirect to='/map' />
Expand All @@ -39,18 +44,11 @@ class Find extends Component {
{/*<Label for='find'>{i18n.Home.find_events}</Label>*/}
<InputGroup>
<Input
id='find'
type='text'
value={search}
invalid={error}
placeholder='Search Skills, Projects and/or Causes'
onChange={this.handleSearch}
onFocus={this.removeError}
onKeyPress={this.handleKeyPress}
placeholder={form.global_search.text_input.placeholder}
/>
<InputGroupAddon addonType='append'>
<Button onClick={this.findBySearch} disabled={isGettingLocation}>
GLOBAL
<Button>
{form.global_search.button.text}
</Button>
</InputGroupAddon>
</InputGroup>
Expand All @@ -62,14 +60,14 @@ class Find extends Component {
type='text'
value={search}
invalid={error}
placeholder='Search City, Town, Village or Nation'
placeholder={form.local_search.text_input.placeholder}
onChange={this.handleSearch}
onFocus={this.removeError}
onKeyPress={this.handleKeyPress}
/>
<InputGroupAddon addonType='append'>
<Button onClick={this.findBySearch} disabled={isGettingLocation}>
LOCAL
{form.local_search.button.text}
</Button>
</InputGroupAddon>
</InputGroup>
Expand Down