@@ -33,21 +33,6 @@ class AddCatalogPriceForm extends React.PureComponent {
33
33
} ) ;
34
34
}
35
35
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
-
51
36
handleSubmit ( event ) {
52
37
event . preventDefault ( ) ;
53
38
@@ -108,7 +93,6 @@ class AddCatalogPriceForm extends React.PureComponent {
108
93
hasServerError = { this . state . hasServerError }
109
94
handleChangeCatalog = { this . handleChangeCatalog }
110
95
catalog = { this . state . catalog }
111
- getCurrencyByCatalogName = { this . getCurrencyByCatalogName }
112
96
handleChangePrice = { this . handleChangePrice }
113
97
validationErrors = { this . state . validationErrors }
114
98
isDisabled = { this . state . isDisabled }
@@ -118,10 +102,24 @@ class AddCatalogPriceForm extends React.PureComponent {
118
102
}
119
103
120
104
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
+ }
121
119
render ( ) {
122
- const { handleSubmit, hasServerError, handleChangeCatalog, handleChangePrice, validationErrors, isDisabled, catalog, getCurrencyByCatalogName } = this . props ;
120
+ const { handleSubmit, hasServerError, handleChangeCatalog, handleChangePrice, validationErrors, isDisabled, catalog} = this . props ;
123
121
const hasValidationErrors = validationErrors . length > 0 ;
124
- const [ currencySymbol , currencyName ] = getCurrencyByCatalogName ( catalog ) ;
122
+ const [ currencySymbol , currencyName ] = this . getCurrencyByCatalogName ( catalog ) ;
125
123
126
124
return (
127
125
< div className = "col-sm-12 form-group" >
0 commit comments