Skip to content
Snippets Groups Projects
Commit 317b0247 authored by esikkala's avatar esikkala
Browse files

Translate text facet placeholder

parent 5e90906e
No related branches found
No related tags found
No related merge requests found
import React from 'react'
import PropTypes from 'prop-types'
import intl from 'react-intl-universal'
import { withStyles } from '@material-ui/core/styles'
import IconButton from '@material-ui/core/IconButton'
import SearchIcon from '@material-ui/icons/Search'
......@@ -63,13 +64,14 @@ class TextFacet extends React.Component {
}
render () {
const { classes } = this.props
const { classes, facetClass, facetID } = this.props
const placeholder = intl.get(`perspectives.${facetClass}.properties.${facetID}.textFacetInputPlaceholder`)
let searchButton = null
const textResultsFetching = false
if (textResultsFetching) {
searchButton = (
<IconButton
aria-label='Search places'
aria-label={placeholder}
>
<CircularProgress size={24} />
</IconButton>
......@@ -77,7 +79,7 @@ class TextFacet extends React.Component {
} else {
searchButton = (
<IconButton
aria-label='Search'
aria-label={placeholder}
onClick={this.handleClick}
onMouseDown={this.handleMouseDown}
>
......@@ -89,7 +91,7 @@ class TextFacet extends React.Component {
return (
<div className={classes.root}>
<FormControl className={classes.textSearch}>
<InputLabel htmlFor='adornment-search'>Search</InputLabel>
<InputLabel htmlFor='adornment-search'>{placeholder}</InputLabel>
<Input
id='adornment-search'
type='text'
......
......@@ -275,7 +275,8 @@ export default {
},
prefLabel: {
label: 'Label',
description: 'A short label describing the manuscript.'
description: 'A short label describing the manuscript.',
textFacetInputPlaceholder: 'Search...'
},
author: {
label: 'Author',
......@@ -488,7 +489,8 @@ export default {
},
prefLabel: {
label: 'Title',
description: 'The name or title of the Work.'
description: 'The name or title of the Work.',
textFacetInputPlaceholder: 'Search...'
},
author: {
label: 'Possible author',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment