1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Creating component for sharing URL fo the profile page

This commit is contained in:
Jamie Hewitt 2023-01-04 15:43:48 +00:00
parent a60324e95c
commit 2344fc74bf
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,3 @@
.share {
padding: 10px;
}

View File

@ -0,0 +1,20 @@
import React, { ReactElement } from 'react'
import styles from './Share.module.css'
import Button from '@shared/atoms/Button'
export default function Share({
accountId
}: {
accountId: string
}): ReactElement {
function copyLink() {
navigator.clipboard.writeText(window.location.href + '/' + accountId)
}
return (
<div className={styles.share}>
<Button className={styles.button} onClick={copyLink} style="text">
Share
</Button>
</div>
)
}

View File

@ -5,6 +5,7 @@ import Stats from './Stats'
import Account from './Account'
import styles from './index.module.css'
import { useProfile } from '@context/Profile'
import Share from './Share'
const isDescriptionTextClamped = () => {
const el = document.getElementById('description')
@ -35,6 +36,7 @@ export default function AccountHeader({
<div className={styles.grid}>
<div>
<Account accountId={accountId} />
<Share accountId={accountId} />
<Stats accountId={accountId} />
</div>