Skip to content

Commit

Permalink
email. Added copy to clipboard on email
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyco97 committed Nov 4, 2024
1 parent ed73816 commit 80f2440
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/common/CopyComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const CopyToClipboard: React.FC<CopyToClipboardProps> = ({ number, id }) => {
event.preventDefault()
event.stopPropagation()

navigator.clipboard.writeText(number).then(() => {
navigator.clipboard.writeText(number?.trim()).then(() => {
setShowMessage(true)
setTimeout(() => setShowMessage(false), 2000)
})
Expand Down
4 changes: 3 additions & 1 deletion components/phonebook/ContactSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,13 @@ export const ContactSummary = forwardRef<HTMLButtonElement, ContactSummaryProps>
<a
target='_blank'
rel='noreferrer'
href={`mailto: ${contact?.workemail}`}
href={`mailto:${contact?.workemail?.trim()}`}
className='truncate hover:underline text-gray-900 dark:text-gray-100'
>
{contact?.workemail}
</a>
{/* copy component */}
<CopyComponent number={contact?.workemail} id='work-email' />
</div>
</dd>
</div>
Expand Down
1 change: 0 additions & 1 deletion components/settings/Integrations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
} from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { Button, InlineNotification, Modal } from '../common'
import { CopyToClipboard } from 'react-copy-to-clipboard'
import { useSelector } from 'react-redux'
import { RootState } from '../../store'
import { newIslandConfig } from '../../lib/settings'
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@nethesis/nethesis-brands-svg-icons": "github:nethesis/Font-Awesome#ns-brands",
"@nethesis/nethesis-light-svg-icons": "github:nethesis/Font-Awesome#ns-light",
"@nethesis/nethesis-solid-svg-icons": "github:nethesis/Font-Awesome#ns-solid",
"@nethesis/phone-island": "^0.8.21",
"@nethesis/phone-island": "^0.8.22",
"@rematch/core": "^2.2.0",
"@rematch/immer": "^2.1.3",
"@types/crypto-js": "^4.1.1",
Expand Down

0 comments on commit 80f2440

Please sign in to comment.