1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

output fees in dynamic price UI

This commit is contained in:
Matthias Kretschmann 2020-09-16 15:55:40 +02:00
parent 865c4d7b9d
commit a1da02b8e4
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 104 additions and 25 deletions

View File

@ -106,8 +106,10 @@
"title": "Dynamic", "title": "Dynamic",
"info": "Let's create a decentralized, automated market for your data set. A Data Token for this data set, worth the entered amount of OCEAN, will be created. Additionally, you will provide liquidity into a Data Token/OCEAN liquidity pool with Balancer.", "info": "Let's create a decentralized, automated market for your data set. A Data Token for this data set, worth the entered amount of OCEAN, will be created. Additionally, you will provide liquidity into a Data Token/OCEAN liquidity pool with Balancer.",
"tooltips": { "tooltips": {
"poolInfo": "Help me", "poolInfo": "Explain what is going on here...",
"liquidityProviderFee": "Help me" "liquidityProviderFee": "Explain liquidity provider fee...",
"communityFee": "Explain community fee...",
"marketplaceFee": "Explain marketplace fee..."
} }
} }
} }

View File

@ -207,6 +207,12 @@
font-size: var(--font-size-small); font-size: var(--font-size-small);
} }
.prefix.small,
.postfix.small {
min-height: 34px;
font-size: var(--font-size-mini);
}
.selectSmall { .selectSmall {
composes: small; composes: small;
height: 34px; height: 34px;

View File

@ -7,7 +7,11 @@ import Terms from '../../molecules/FormFields/Terms'
import Price from '../../molecules/FormFields/Price' import Price from '../../molecules/FormFields/Price'
const DefaultInput = (props: InputProps) => ( const DefaultInput = (props: InputProps) => (
<input className={styles.input} id={props.name} {...props} /> <input
className={`${styles.input} ${props.small ? styles.small : null}`}
id={props.name}
{...props}
/>
) )
export default function InputElement({ export default function InputElement({
@ -75,12 +79,30 @@ export default function InputElement({
default: default:
return prefix || postfix ? ( return prefix || postfix ? (
<div className={`${prefix ? styles.prefixGroup : styles.postfixGroup}`}> <div className={`${prefix ? styles.prefixGroup : styles.postfixGroup}`}>
{prefix && <div className={styles.prefix}>{prefix}</div>} {prefix && (
<DefaultInput name={name} type={type || 'text'} {...props} /> <div className={`${styles.prefix} ${small ? styles.small : ''}`}>
{postfix && <div className={styles.postfix}>{postfix}</div>} {prefix}
</div>
)}
<DefaultInput
name={name}
type={type || 'text'}
small={small}
{...props}
/>
{postfix && (
<div className={`${styles.postfix} ${small ? styles.small : ''}`}>
{postfix}
</div>
)}
</div> </div>
) : ( ) : (
<DefaultInput name={name} type={type || 'text'} {...props} /> <DefaultInput
name={name}
type={type || 'text'}
small={small}
{...props}
/>
) )
} }
} }

View File

@ -34,7 +34,8 @@
padding-bottom: calc(var(--spacer) / 3); padding-bottom: calc(var(--spacer) / 3);
} }
.tokens { .tokens,
.fees {
display: grid; display: grid;
margin-left: -2rem; margin-left: -2rem;
@ -48,15 +49,28 @@
} }
} }
.summary { .fees {
text-align: center;
margin-top: var(--spacer); margin-top: var(--spacer);
padding: var(--spacer);
padding-top: 0;
gap: var(--spacer);
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
align-items: center;
border-bottom: 1px solid var(--brand-grey-lighter);
} }
.summary input { .fees label {
white-space: nowrap;
}
.fees input {
max-width: 5rem; max-width: 5rem;
} }
.summary {
margin-top: var(--spacer);
}
.alertArea { .alertArea {
margin-left: -2rem; margin-left: -2rem;
margin-right: -2rem; margin-right: -2rem;

View File

@ -100,7 +100,8 @@ export default function Dynamic({
/> />
</div> </div>
<footer className={styles.summary}> <div className={styles.fees}>
<div>
<Label htmlFor="liquidityProviderFee"> <Label htmlFor="liquidityProviderFee">
Liquidity Provider Fee{' '} Liquidity Provider Fee{' '}
<Tooltip content={content.tooltips.liquidityProviderFee} /> <Tooltip content={content.tooltips.liquidityProviderFee} />
@ -114,7 +115,39 @@ export default function Dynamic({
min="0.1" min="0.1"
max="0.9" max="0.9"
step="0.1" step="0.1"
small
/> />
</div>
<div>
<Label htmlFor="communityFee">
Community Fee <Tooltip content={content.tooltips.communityFee} />
</Label>
<InputElement
value="0.1"
name="communityFee"
postfix="%"
readOnly
small
/>
</div>
<div>
<Label htmlFor="marketplaceFee">
Marketplace Fee{' '}
<Tooltip content={content.tooltips.marketplaceFee} />
</Label>
<InputElement
value={appConfig.marketFeeAmount}
name="marketplaceFee"
postfix="%"
readOnly
small
/>
</div>
</div>
<footer className={styles.summary}>
You will get: <br />
100% share of pool
</footer> </footer>
{error && ( {error && (

View File

@ -26,6 +26,8 @@ const query = graphql`
tooltips { tooltips {
poolInfo poolInfo
liquidityProviderFee liquidityProviderFee
communityFee
marketplaceFee
} }
} }
} }