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

fix lint error

This commit is contained in:
Bogdan Fazakas 2021-08-04 18:42:46 +03:00
parent e998a989b5
commit a456b55a32
2 changed files with 11 additions and 11 deletions

View File

@ -15,24 +15,23 @@ interface HistoryTab {
content: JSX.Element content: JSX.Element
} }
function getTabs(accountIdentifier: string): HistoryTab[] { function getTabs(accountId: string, userAccountId: string): HistoryTab[] {
const { accountId } = useWeb3()
const defaultTabs: HistoryTab[] = [ const defaultTabs: HistoryTab[] = [
{ {
title: 'Published', title: 'Published',
content: <PublishedList accountId={accountIdentifier} /> content: <PublishedList accountId={accountId} />
}, },
{ {
title: 'Pool Shares', title: 'Pool Shares',
content: <PoolShares accountId={accountIdentifier} /> content: <PoolShares accountId={accountId} />
}, },
{ {
title: 'Pool Transactions', title: 'Pool Transactions',
content: <PoolTransactions accountId={accountIdentifier} /> content: <PoolTransactions accountId={accountId} />
}, },
{ {
title: 'Downloads', title: 'Downloads',
content: <Downloads accountId={accountIdentifier} /> content: <Downloads accountId={accountId} />
} }
] ]
const computeTab: HistoryTab = { const computeTab: HistoryTab = {
@ -43,21 +42,22 @@ function getTabs(accountIdentifier: string): HistoryTab[] {
</OceanProvider> </OceanProvider>
) )
} }
if (accountIdentifier === accountId) { if (accountId === userAccountId) {
defaultTabs.push(computeTab) defaultTabs.push(computeTab)
} }
return defaultTabs return defaultTabs
} }
export default function HistoryPage({ export default function HistoryPage({
accountId accountIdentifier
}: { }: {
accountId: string accountIdentifier: string
}): ReactElement { }): ReactElement {
const { chainIds } = useUserPreferences() const { chainIds } = useUserPreferences()
const { accountId } = useWeb3()
const url = new URL(window.location.href) const url = new URL(window.location.href)
const defaultTab = url.searchParams.get('defaultTab') const defaultTab = url.searchParams.get('defaultTab')
const tabs = getTabs(accountId) const tabs = getTabs(accountIdentifier, accountId)
let defaultTabIndex = 0 let defaultTabIndex = 0
defaultTab === 'ComputeJobs' ? (defaultTabIndex = 4) : (defaultTabIndex = 0) defaultTab === 'ComputeJobs' ? (defaultTabIndex = 4) : (defaultTabIndex = 0)
return ( return (

View File

@ -17,7 +17,7 @@ export default function AccountPage({
) : ( ) : (
<p>Please connect your Web3 wallet.</p> <p>Please connect your Web3 wallet.</p>
)} )}
<HistoryPage accountId={accountIdentifier} /> <HistoryPage accountIdentifier={accountIdentifier} />
</article> </article>
) )
} }