Fixed phone # formatting issues. BOD-308

This commit is contained in:
Patrick Fic
2020-09-03 09:18:53 -07:00
parent f3b32fae76
commit 2adb72b25f
4 changed files with 9 additions and 19 deletions

View File

@@ -45,7 +45,6 @@
"react-icons": "^3.11.0",
"react-image-file-resizer": "^0.3.6",
"react-moment": "^0.9.7",
"react-number-format": "^4.4.1",
"react-redux": "^7.2.1",
"react-resizable": "^1.10.1",
"react-router-dom": "^5.2.0",

View File

@@ -9,7 +9,10 @@ export function ChatOpenButton({ phone, jobid, openChatByPhone }) {
return (
<MessageFilled
style={{ margin: 4 }}
onClick={() => openChatByPhone({ phone_num: phone, jobid: jobid })}
onClick={(e) => {
e.stopPropagation();
openChatByPhone({ phone_num: phone, jobid: jobid });
}}
/>
);
}

View File

@@ -1,13 +1,8 @@
import React from "react";
import NumberFormat from "react-number-format";
//import NumberFormat from "react-number-format";
import phone from "phone";
export default function PhoneNumberFormatter(props) {
return (
<NumberFormat
value={props.children}
type="tel"
format="+# (###)-###-####"
displayType={"text"}
/>
);
const p = phone(props.children);
return <span>{p[0]}</span>;
}

View File

@@ -11358,13 +11358,6 @@ react-moment@^0.9.7:
resolved "https://registry.yarnpkg.com/react-moment/-/react-moment-0.9.7.tgz#ca570466595b1aa4f7619e62da18b3bb2de8b6f3"
integrity sha512-ifzUrUGF6KRsUN2pRG5k56kO0mJBr8kRkWb0wNvtFIsBIxOuPxhUpL1YlXwpbQCbHq23hUu6A0VEk64HsFxk9g==
react-number-format@^4.4.1:
version "4.4.1"
resolved "https://registry.yarnpkg.com/react-number-format/-/react-number-format-4.4.1.tgz#d5614dd25edfc21ed48b97356213440081437a94"
integrity sha512-ZGFMXZ0U7DcmQ3bSZY3FULOA1mfqreT9NIMYZNoa/ouiSgiTQiYA95Uj2KN8ge6BRr+ghA5vraozqWqsHZQw3Q==
dependencies:
prop-types "^15.7.2"
react-overlays@^2.0.0-0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/react-overlays/-/react-overlays-2.1.1.tgz#ffe2090c4a10da6b8947a1c7b1a67d0457648a0d"