mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
fix "owned by" label on preview (#1303)
* fix "owner by" label on preview * cleanup - remove unused code * restore 3box
This commit is contained in:
parent
65f0c5c675
commit
0ade87c971
@ -5,8 +5,6 @@ import Link from 'next/link'
|
|||||||
import get3BoxProfile from '@utils/profile'
|
import get3BoxProfile from '@utils/profile'
|
||||||
import { accountTruncate } from '@utils/web3'
|
import { accountTruncate } from '@utils/web3'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import Add from './Add'
|
|
||||||
import { useWeb3 } from '@context/Web3'
|
|
||||||
import { getEnsName } from '@utils/ens'
|
import { getEnsName } from '@utils/ens'
|
||||||
import { useIsMounted } from '@hooks/useIsMounted'
|
import { useIsMounted } from '@hooks/useIsMounted'
|
||||||
|
|
||||||
@ -21,17 +19,18 @@ export default function Publisher({
|
|||||||
minimal?: boolean
|
minimal?: boolean
|
||||||
className?: string
|
className?: string
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
// const { accountId } = useWeb3()
|
|
||||||
const isMounted = useIsMounted()
|
const isMounted = useIsMounted()
|
||||||
const [profile, setProfile] = useState<Profile>()
|
const [profile, setProfile] = useState<Profile>()
|
||||||
const [name, setName] = useState(accountTruncate(account))
|
const [name, setName] = useState('')
|
||||||
const [accountEns, setAccountEns] = useState<string>()
|
const [accountEns, setAccountEns] = useState<string>()
|
||||||
|
|
||||||
// const showAdd = account === accountId && !profile
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!account) return
|
if (!account) return
|
||||||
|
|
||||||
|
// set default name on hook
|
||||||
|
// to avoid side effect (UI not updating on account's change)
|
||||||
|
setName(accountTruncate(account))
|
||||||
|
|
||||||
const source = axios.CancelToken.source()
|
const source = axios.CancelToken.source()
|
||||||
|
|
||||||
async function getExternalName() {
|
async function getExternalName() {
|
||||||
@ -70,7 +69,6 @@ export default function Publisher({
|
|||||||
<Link href={`/profile/${accountEns || account}`}>
|
<Link href={`/profile/${accountEns || account}`}>
|
||||||
<a title="Show profile page.">{name}</a>
|
<a title="Show profile page.">{name}</a>
|
||||||
</Link>
|
</Link>
|
||||||
{/* {showAdd && <Add />} */}
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user