mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01: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:
parent
1560c69239
commit
f5e01d7c0c
@ -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>
|
||||
)
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user