1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-06-26 03:06:49 +02:00

Display compute jobs history tab for a successful job (#652)

* selected tab added

* preselect and display compute jobs history

* defaultIndex prop used

Co-authored-by: claudia.holhos <claudia.holhos@hpm.ro>
This commit is contained in:
claudiaHash 2021-06-08 14:35:06 +03:00 committed by GitHub
parent 1560c69239
commit f5e01d7c0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -40,7 +40,7 @@ import { secondsToString } from '../../../../utils/metadata'
import { getPreviousOrders, getPrice } from '../../../../utils/subgraph'
const SuccessAction = () => (
<Button style="text" to="/history" size="small">
<Button style="text" to="/history?defaultTab=ComputeJobs" size="small">
Go to history
</Button>
)

View File

@ -31,9 +31,17 @@ const tabs = [
]
export default function HistoryPage(): ReactElement {
const url = new URL(window.location.href)
const defaultTab = url.searchParams.get('defaultTab')
let defaultTabIndex = 0
defaultTab === 'ComputeJobs' ? (defaultTabIndex = 4) : (defaultTabIndex = 0)
return (
<article className={styles.content}>
<Tabs items={tabs} className={styles.tabs} />
<Tabs
items={tabs}
className={styles.tabs}
defaultIndex={defaultTabIndex}
/>
</article>
)
}