Pluralize button text based on number of files
This commit is contained in:
@@ -37,6 +37,10 @@ export default class PlacePhotoUpload extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get photoWord() {
|
||||||
|
return this.files.length === 1 ? 'Photo' : 'Photos';
|
||||||
|
}
|
||||||
|
|
||||||
@action
|
@action
|
||||||
handleFileSelect(event) {
|
handleFileSelect(event) {
|
||||||
this.addFiles(event.target.files);
|
this.addFiles(event.target.files);
|
||||||
@@ -251,7 +255,7 @@ export default class PlacePhotoUpload extends Component {
|
|||||||
{{else}}
|
{{else}}
|
||||||
Publish
|
Publish
|
||||||
{{this.files.length}}
|
{{this.files.length}}
|
||||||
Photo(s)
|
{{this.photoWord}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
Reference in New Issue
Block a user