Skip to content

Commit 0be86ac

Browse files
committed
commit
1 parent a743a1d commit 0be86ac

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

src/main/frontend/src/components/AddCatalogPriceForm.js

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,6 @@ class AddCatalogPriceForm extends React.PureComponent {
3333
});
3434
}
3535

36-
getCurrencyByCatalogName(catalog) {
37-
switch (catalog) {
38-
case 'michel':
39-
case 'yvert':
40-
return ['\u20AC', 'EUR'];
41-
case 'scott':
42-
return ['$', 'USD'];
43-
case 'gibbons':
44-
return ['\u00A3', 'GBP'];
45-
case 'solovyov':
46-
case 'zagorski':
47-
return ['\u20BD', 'RUB'];
48-
}
49-
}
50-
5136
handleSubmit(event) {
5237
event.preventDefault();
5338

@@ -108,7 +93,6 @@ class AddCatalogPriceForm extends React.PureComponent {
10893
hasServerError={this.state.hasServerError}
10994
handleChangeCatalog={this.handleChangeCatalog}
11095
catalog={this.state.catalog}
111-
getCurrencyByCatalogName={this.getCurrencyByCatalogName}
11296
handleChangePrice={this.handleChangePrice}
11397
validationErrors={this.state.validationErrors}
11498
isDisabled={this.state.isDisabled}
@@ -118,10 +102,24 @@ class AddCatalogPriceForm extends React.PureComponent {
118102
}
119103

120104
class AddCatalogPriceFormView extends React.PureComponent {
105+
getCurrencyByCatalogName(catalog) {
106+
switch (catalog) {
107+
case 'michel':
108+
case 'yvert':
109+
return ['\u20AC', 'EUR'];
110+
case 'scott':
111+
return ['$', 'USD'];
112+
case 'gibbons':
113+
return ['\u00A3', 'GBP'];
114+
case 'solovyov':
115+
case 'zagorski':
116+
return ['\u20BD', 'RUB'];
117+
}
118+
}
121119
render() {
122-
const {handleSubmit, hasServerError, handleChangeCatalog, handleChangePrice, validationErrors, isDisabled, catalog, getCurrencyByCatalogName} = this.props;
120+
const {handleSubmit, hasServerError, handleChangeCatalog, handleChangePrice, validationErrors, isDisabled, catalog} = this.props;
123121
const hasValidationErrors = validationErrors.length > 0;
124-
const [currencySymbol, currencyName] = getCurrencyByCatalogName(catalog);
122+
const [currencySymbol, currencyName] = this.getCurrencyByCatalogName(catalog);
125123

126124
return (
127125
<div className="col-sm-12 form-group">

0 commit comments

Comments
 (0)