Adjusted phone formatting libraries. IO-483
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import React from "react";
|
||||
//import NumberFormat from "react-number-format";
|
||||
import phone from "phone";
|
||||
export default function PhoneNumberFormatter(props) {
|
||||
const p = phone(props.children);
|
||||
import parsePhoneNumber from "libphonenumber-js";
|
||||
import React from "react";
|
||||
|
||||
return <span>{p[0]}</span>;
|
||||
export default function PhoneNumberFormatter(props) {
|
||||
const p = parsePhoneNumber(props.children, "CA");
|
||||
return p ? <span>{p.formatInternational()}</span> : null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user