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:
parent
a60324e95c
commit
2344fc74bf
3
src/components/Profile/Header/Share.module.css
Normal file
3
src/components/Profile/Header/Share.module.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.share {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
20
src/components/Profile/Header/Share.tsx
Normal file
20
src/components/Profile/Header/Share.tsx
Normal 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>
|
||||||
|
)
|
||||||
|
}
|
@ -5,6 +5,7 @@ import Stats from './Stats'
|
|||||||
import Account from './Account'
|
import Account from './Account'
|
||||||
import styles from './index.module.css'
|
import styles from './index.module.css'
|
||||||
import { useProfile } from '@context/Profile'
|
import { useProfile } from '@context/Profile'
|
||||||
|
import Share from './Share'
|
||||||
|
|
||||||
const isDescriptionTextClamped = () => {
|
const isDescriptionTextClamped = () => {
|
||||||
const el = document.getElementById('description')
|
const el = document.getElementById('description')
|
||||||
@ -35,6 +36,7 @@ export default function AccountHeader({
|
|||||||
<div className={styles.grid}>
|
<div className={styles.grid}>
|
||||||
<div>
|
<div>
|
||||||
<Account accountId={accountId} />
|
<Account accountId={accountId} />
|
||||||
|
<Share accountId={accountId} />
|
||||||
<Stats accountId={accountId} />
|
<Stats accountId={accountId} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user