Fix missingKey warning with helper text
This commit is contained in:
1 parent
14a08a303b
commit
f564636cb4
1 file changed
+18
-3
@@ -182,7 +182,12 @@ const PasswordPanel = () => {
|
|||||||
value={localData.password}
|
value={localData.password}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors[idToName["edit-current-password"]] ? true : false}
|
error={errors[idToName["edit-current-password"]] ? true : false}
|
||||||
helperText={t(errors[idToName["edit-current-password"]])}
|
helperText={
|
||||||
|
//Only call t() if there is an error to prevent unnecessary localization calls
|
||||||
|
errors[idToName["edit-current-password"]]
|
||||||
|
? t(errors[idToName["edit-current-password"]])
|
||||||
|
: ""
|
||||||
|
}
|
||||||
endAdornment={<PasswordEndAdornment />}
|
endAdornment={<PasswordEndAdornment />}
|
||||||
flex={1}
|
flex={1}
|
||||||
/>
|
/>
|
||||||
@@ -208,7 +213,12 @@ const PasswordPanel = () => {
|
|||||||
value={localData.newPassword}
|
value={localData.newPassword}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors[idToName["edit-new-password"]] ? true : false}
|
error={errors[idToName["edit-new-password"]] ? true : false}
|
||||||
helperText={t(errors[idToName["edit-new-password"]])}
|
helperText={
|
||||||
|
//Only call t() if there is an error to prevent unnecessary localization calls
|
||||||
|
errors[idToName["edit-new-password"]]
|
||||||
|
? t(errors[idToName["edit-new-password"]])
|
||||||
|
: ""
|
||||||
|
}
|
||||||
endAdornment={<PasswordEndAdornment />}
|
endAdornment={<PasswordEndAdornment />}
|
||||||
flex={1}
|
flex={1}
|
||||||
/>
|
/>
|
||||||
@@ -234,7 +244,12 @@ const PasswordPanel = () => {
|
|||||||
value={localData.confirm}
|
value={localData.confirm}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors[idToName["edit-confirm-password"]] ? true : false}
|
error={errors[idToName["edit-confirm-password"]] ? true : false}
|
||||||
helperText={t(errors[idToName["edit-confirm-password"]])}
|
helperText={
|
||||||
|
//Only call t() if there is an error to prevent unnecessary localization calls
|
||||||
|
errors[idToName["edit-confirm-password"]]
|
||||||
|
? t(errors[idToName["edit-confirm-password"]])
|
||||||
|
: ""
|
||||||
|
}
|
||||||
endAdornment={<PasswordEndAdornment />}
|
endAdornment={<PasswordEndAdornment />}
|
||||||
flex={1}
|
flex={1}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user