Skip to content

Commit

Permalink
feat(stake-modal): add name of the subcourt to stake in
Browse files Browse the repository at this point in the history
  • Loading branch information
epiqueras committed Mar 9, 2019
1 parent 369b9c4 commit 0013494
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/stake-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ETHAmount from './eth-amount'
import PropTypes from 'prop-types'
import { fluidRange } from 'polished'
import styled from 'styled-components/macro'
import { useDataloader } from '../bootstrap/dataloader'

const StyledModal = styled(Modal)`
max-width: 90%;
Expand Down Expand Up @@ -82,6 +83,13 @@ const StakeModal = Form.create()(({ ID, form, onCancel }) => {
const drizzleState = useDrizzleState(drizzleState => ({
account: drizzleState.accounts[0]
}))
const load = useDataloader.load()
let name
const policy = useCacheCall('PolicyRegistry', 'policies', ID)
if (policy !== undefined) {
const policyJSON = load(policy)
if (policyJSON) name = policyJSON.name
}
const _balance = useCacheCall(
'MiniMeTokenERC20',
'balanceOf',
Expand Down Expand Up @@ -140,7 +148,7 @@ const StakeModal = Form.create()(({ ID, form, onCancel }) => {
}),
[form.validateFieldsAndScroll, ID, stake]
)}
title="Stake PNK in the Court"
title={`Stake PNK in ${name || '-'}`}
visible
width="480px"
>
Expand Down

0 comments on commit 0013494

Please sign in to comment.