-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from dfpc-coe/phone-comp
Phone Comp
- Loading branch information
Showing
6 changed files
with
84 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<template> | ||
<div class='col-12'> | ||
<label class='subheader mx-2'>Phone</label> | ||
<div class='mx-2'> | ||
<CopyField | ||
:text='format(phone)' | ||
:size='24' | ||
> | ||
<a | ||
:href='`tel:${format(phone)}`' | ||
class='cursor-pointer pe-2' | ||
> | ||
<IconPhone | ||
:size='24' | ||
:stroke='1' | ||
/> | ||
</a> | ||
</CopyField> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import CopyField from './CopyField.vue'; | ||
import phoneFormat from 'phone'; | ||
import { | ||
IconPhone | ||
} from '@tabler/icons-vue'; | ||
export default { | ||
name: 'COTPhone', | ||
components: { | ||
CopyField, | ||
IconPhone | ||
}, | ||
props: { | ||
phone: { | ||
type: String, | ||
required: true | ||
}, | ||
unit: { | ||
type: String, | ||
default: 'deg' | ||
} | ||
}, | ||
methods: { | ||
format: function(number) { | ||
const p = phoneFormat(number); | ||
if (!p.isValid) return number; | ||
if (p.countryCode === '+1') { | ||
return `${p.phoneNumber.slice(0, 2)} (${p.phoneNumber.slice(2, 5)}) ${p.phoneNumber.slice(5, 8)}-${p.phoneNumber.slice(8, 12)}`; | ||
} else { | ||
return p; | ||
} | ||
}, | ||
}, | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,4 @@ RUN npm install | |
#ENTRYPOINT ["/usr/local/bin/npx", "aws-lambda-ric"] | ||
#CMD ["app.handler"] | ||
|
||
CMD ["npm", "start"] |