mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
add liquidity screen styling
This commit is contained in:
parent
b45c958ae8
commit
3260df17a9
@ -2,8 +2,26 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.addInput {
|
.addInput {
|
||||||
max-width: 12rem;
|
margin: 0 auto calc(var(--spacer) / 1.5) auto;
|
||||||
margin: 0 auto var(--spacer) auto;
|
background: var(--brand-grey-dimmed);
|
||||||
|
padding: var(--spacer) calc(var(--spacer) * 3) calc(var(--spacer) * 1.2)
|
||||||
|
calc(var(--spacer) * 3);
|
||||||
|
border-bottom: 1px solid var(--brand-grey-lighter);
|
||||||
|
margin-top: -2rem;
|
||||||
|
margin-left: -2rem;
|
||||||
|
margin-right: -2rem;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addInput input {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttonMax {
|
||||||
|
position: absolute;
|
||||||
|
font-size: var(--font-size-mini);
|
||||||
|
bottom: calc(var(--spacer) / 2);
|
||||||
|
right: calc(var(--spacer) * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.userBalance {
|
.userBalance {
|
||||||
@ -16,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.userBalance span + div {
|
.userBalance span + div {
|
||||||
transform: scale(0.7);
|
transform: scale(0.8);
|
||||||
transform-origin: right center;
|
transform-origin: right center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,5 +46,13 @@
|
|||||||
|
|
||||||
.output p {
|
.output p {
|
||||||
font-weight: var(--font-weight-bold);
|
font-weight: var(--font-weight-bold);
|
||||||
margin-bottom: calc(var(--spacer) / 4);
|
margin-bottom: calc(var(--spacer) / 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.output [class*='token'] {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
.output [class*='token'] > figure {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,13 @@ import { useOcean } from '@oceanprotocol/react'
|
|||||||
import Header from './Header'
|
import Header from './Header'
|
||||||
import { toast } from 'react-toastify'
|
import { toast } from 'react-toastify'
|
||||||
import InputElement from '../../../atoms/Input/InputElement'
|
import InputElement from '../../../atoms/Input/InputElement'
|
||||||
|
import Button from '../../../atoms/Button'
|
||||||
import Token from './Token'
|
import Token from './Token'
|
||||||
import { Balance } from './'
|
import { Balance } from './'
|
||||||
import PriceUnit from '../../../atoms/Price/PriceUnit'
|
import PriceUnit from '../../../atoms/Price/PriceUnit'
|
||||||
import Actions from './Actions'
|
import Actions from './Actions'
|
||||||
import { useUserPreferences } from '../../../../providers/UserPreferences'
|
import { useUserPreferences } from '../../../../providers/UserPreferences'
|
||||||
|
|
||||||
// TODO: handle and display all fees somehow
|
|
||||||
|
|
||||||
export default function Add({
|
export default function Add({
|
||||||
setShowAdd,
|
setShowAdd,
|
||||||
poolAddress,
|
poolAddress,
|
||||||
@ -61,13 +60,17 @@ export default function Add({
|
|||||||
setAmount(e.target.value)
|
setAmount(e.target.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleMax() {
|
||||||
|
setAmount(balance.ocean)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.add}>
|
<div className={styles.add}>
|
||||||
<Header title="Add Liquidity" backAction={() => setShowAdd(false)} />
|
<Header title="Add Liquidity" backAction={() => setShowAdd(false)} />
|
||||||
|
|
||||||
<div className={styles.addInput}>
|
<div className={styles.addInput}>
|
||||||
<div className={styles.userBalance}>
|
<div className={styles.userBalance}>
|
||||||
<span>Available:</span>
|
<span>Available: </span>
|
||||||
<PriceUnit price={balance.ocean} symbol="OCEAN" small />
|
<PriceUnit price={balance.ocean} symbol="OCEAN" small />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -79,6 +82,17 @@ export default function Add({
|
|||||||
placeholder="0"
|
placeholder="0"
|
||||||
onChange={handleAmountChange}
|
onChange={handleAmountChange}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{balance.ocean > amount && (
|
||||||
|
<Button
|
||||||
|
className={styles.buttonMax}
|
||||||
|
style="text"
|
||||||
|
size="small"
|
||||||
|
onClick={handleMax}
|
||||||
|
>
|
||||||
|
Use Max
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.output}>
|
<div className={styles.output}>
|
||||||
@ -89,8 +103,10 @@ export default function Add({
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>You will earn</p>
|
<p>You will earn</p>
|
||||||
<Token symbol="%" balance={liquidityProviderFee} />
|
<Token
|
||||||
of each pool transaction
|
symbol="% of each pool transaction"
|
||||||
|
balance={liquidityProviderFee}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user