Skip to content

Commit 5e2800a

Browse files
committed
cip95tools is updated
1 parent 3761fcb commit 5e2800a

File tree

2 files changed

+37
-8
lines changed

2 files changed

+37
-8
lines changed

src/components/tabs/subtabs/cip95AdditionalPart.js

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React, {useState} from 'react'
2-
import VoteDelationCard from '../../cards/voteDelegation'
32
import {getCertificateBuilder} from '../../../utils/cslTools'
3+
import TabsComponent from '../tabsComponent'
4+
import GovBasicFunctionsTab from './govBasicFunctionsTab'
5+
import GovActionsTab from './govActionsTab'
6+
import ConstitCommCertsTab from './constitCommCertsTab'
47

58
const Cip95AdditionalPart = ({api, wasm, onWaiting, onError, getters, setters}) => {
69
const [currentCertsInTx, setCertInTx] = useState([])
@@ -27,18 +30,35 @@ const Cip95AdditionalPart = ({api, wasm, onWaiting, onError, getters, setters})
2730
const newGetters = Object.assign(getters, {currentCertsInTx, getCertBuilder})
2831
const newSetters = Object.assign(setters, {handleAddingCertInTx})
2932

30-
return (
31-
<div className="grid justify-items-stretch grid-cols-1 lg:grid-cols-5 gap-2">
32-
<div>
33-
<VoteDelationCard
33+
const data = [
34+
{
35+
label: 'Governance Basic Functions',
36+
value: 'govBasicFuncs',
37+
children: (
38+
<GovBasicFunctionsTab
3439
api={api}
3540
wasm={wasm}
3641
onWaiting={onWaiting}
3742
onError={onError}
3843
getters={newGetters}
3944
setters={newSetters}
4045
/>
41-
</div>
46+
),
47+
},
48+
{
49+
label: 'Governance Actions',
50+
value: 'govActions',
51+
children: <GovActionsTab />,
52+
},
53+
{
54+
label: 'Constitutional Commitee Certs',
55+
value: 'ccCerts',
56+
children: <ConstitCommCertsTab />,
57+
},
58+
]
59+
return (
60+
<div className="block rounded-lg border bg-gray-900 border-gray-700">
61+
<TabsComponent tabsData={data} />
4262
</div>
4363
)
4464
}

src/components/tabs/subtabs/cip95ToolsTab.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const Cip95TabTools = () => {
2929
// Unregistered public stake key
3030
const [currentUnregPubStakeKey, setUnregPubStakeKey] = useState('')
3131

32-
const showWarning = () =>{
32+
const showWarning = () => {
3333
setErrorState(true)
3434
setTimeout(() => setErrorState(false), 3000)
3535
}
@@ -72,14 +72,23 @@ const Cip95TabTools = () => {
7272
{/* info panel here */}
7373
<InfoPanel getters={getters} />
7474
</div>
75+
{/* Info and error message is here */}
7576
<div className="grid justify-items-center content-end h-12 text-2xl">
7677
<label className="text-white">{currentWaiterState ? 'Waiting ...' : ''}</label>
7778
<label className="text-red-500">
7879
{currentErrorState ? 'An error has happend. Please check logs.' : ''}
7980
</label>
8081
</div>
82+
{/* Tabs with gov. actions */}
8183
<div>
82-
<Cip95AdditionalPart api={api} wasm={wasm} onWaiting={setWaiterState} onError={showWarning} getters={getters} setters={setters} />
84+
<Cip95AdditionalPart
85+
api={api}
86+
wasm={wasm}
87+
onWaiting={setWaiterState}
88+
onError={showWarning}
89+
getters={getters}
90+
setters={setters}
91+
/>
8392
</div>
8493
</div>
8594
) : (

0 commit comments

Comments
 (0)