fix "owned by" label on preview (#1303)

* fix "owner by" label on preview

* cleanup - remove unused code

* restore 3box
This commit is contained in:
EnzoVezzaro 2022-04-04 09:16:22 -04:00 committed by GitHub
parent 65f0c5c675
commit 0ade87c971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 7 deletions

View File

@ -5,8 +5,6 @@ import Link from 'next/link'
import get3BoxProfile from '@utils/profile'
import { accountTruncate } from '@utils/web3'
import axios from 'axios'
import Add from './Add'
import { useWeb3 } from '@context/Web3'
import { getEnsName } from '@utils/ens'
import { useIsMounted } from '@hooks/useIsMounted'
@ -21,17 +19,18 @@ export default function Publisher({
minimal?: boolean
className?: string
}): ReactElement {
// const { accountId } = useWeb3()
const isMounted = useIsMounted()
const [profile, setProfile] = useState<Profile>()
const [name, setName] = useState(accountTruncate(account))
const [name, setName] = useState('')
const [accountEns, setAccountEns] = useState<string>()
// const showAdd = account === accountId && !profile
useEffect(() => {
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()
async function getExternalName() {
@ -70,7 +69,6 @@ export default function Publisher({
<Link href={`/profile/${accountEns || account}`}>
<a title="Show profile page.">{name}</a>
</Link>
{/* {showAdd && <Add />} */}
</>
)}
</div>