Adjusted phone formatting libraries. IO-483

This commit is contained in:
Patrick Fic
2021-02-02 16:19:22 -08:00
parent 809ba0934a
commit 0bbfb259c0
4 changed files with 16 additions and 15 deletions

View File

@@ -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;
}