Improve UI
* Improve Liquidity provider instructions * Add outcome label to redeem winner
This commit is contained in:
parent
bced94028d
commit
4699f0666f
|
@ -172,18 +172,6 @@ export const AddLiquidityView = (props: {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
<div>
|
|
||||||
<Popover
|
|
||||||
trigger="hover"
|
|
||||||
content={
|
|
||||||
<div style={{ width: 300 }}>
|
|
||||||
Provide Liquidity to pool in one step.
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Button type="text">What is this.</Button>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<Popover
|
<Popover
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
|
@ -196,7 +184,7 @@ export const AddLiquidityView = (props: {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Button type="text">Read more about providing liquidity.</Button>
|
<Button type="text">Provide Liquidity to both pools</Button>
|
||||||
</Popover>
|
</Popover>
|
||||||
</div>
|
</div>
|
||||||
<CurrencyInput
|
<CurrencyInput
|
||||||
|
|
|
@ -146,6 +146,7 @@ export const RedeemView = (props) => {
|
||||||
exp_time: 1612137600, // 02/01/2021 00:00 UTC
|
exp_time: 1612137600, // 02/01/2021 00:00 UTC
|
||||||
decided: false
|
decided: false
|
||||||
});
|
});
|
||||||
|
const [winnerOutcome, setWinnerOutcome] = useState("");
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function fetchContractData(market) {
|
async function fetchContractData(market) {
|
||||||
|
@ -165,6 +166,17 @@ export const RedeemView = (props) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('contract.exp_time', new Date(contractData.exp_time * 1000));
|
console.log('contract.exp_time', new Date(contractData.exp_time * 1000));
|
||||||
console.log('contract.decided', contractData.decided);
|
console.log('contract.decided', contractData.decided);
|
||||||
|
if (contractData.winner) {
|
||||||
|
const winner_pk = new PublicKey(contractData.winner).toBase58();
|
||||||
|
console.log('winner_pk', winner_pk);
|
||||||
|
markets.forEach(m => {
|
||||||
|
m.outcomes.forEach(o => {
|
||||||
|
if (o.mint_pk === winner_pk) {
|
||||||
|
setWinnerOutcome(o.name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}, [contractData]);
|
}, [contractData]);
|
||||||
|
|
||||||
async function createTokenAccountTransaction(mintPubkey) {
|
async function createTokenAccountTransaction(mintPubkey) {
|
||||||
|
@ -335,6 +347,7 @@ export const RedeemView = (props) => {
|
||||||
style={{
|
style={{
|
||||||
"margin-bottom": 10,
|
"margin-bottom": 10,
|
||||||
}}
|
}}
|
||||||
|
addonAfter={winnerOutcome}
|
||||||
placeholder="0.00"
|
placeholder="0.00"
|
||||||
disabled={!contractData.decided}
|
disabled={!contractData.decided}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue