Browse Source

Fixing phone format in AccountScreen when 8 digits number is chosen

master
GabrielTrettel 3 years ago
parent
commit
3c9c985281
  1. 17
      src/app/screens/AccountScreen.js

17
src/app/screens/AccountScreen.js

@ -15,7 +15,22 @@ function UserHeader({ name, fone }) {
const index = utils.hashPhoneNumber(fone) % assets.avatar.length || 2
const Avatar = assets.avatar[index];
const _mask = fone?.length >= 12 ? "(999) 99999-9999" : "(99) 99999-9999";
var _mask = "";
switch (fone?.length) {
case 12:
_mask = "(999) 99999-9999" ;
break;
case 11:
_mask = "(99) 99999-9999"
break;
case 10:
_mask = "(99) 9999-9999"
break;
default:
_mask = "(99) 9999-9999"
break;
}
const fone_mask = mask(fone, _mask);
return (

Loading…
Cancel
Save