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

Remove risks warning (#1420)

* Removing risks warning from add liquidity tab

* Removing risks warning from add trade tab

* Removing isWarningAccepted state variable
This commit is contained in:
Jamie Hewitt 2022-05-11 15:29:07 +03:00 committed by GitHub
parent e30786c97b
commit 8819a66e67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 55 deletions

View File

@ -54,8 +54,7 @@
"titleIn": "You will receive",
"titleOut": "Pool conversion"
},
"action": "Supply",
"warning": "Use at your own risk. Please familiarize yourself [with the risks](https://blog.oceanprotocol.com/on-staking-on-data-in-ocean-market-3d8e09eb0a13) and the [Terms of Use](/terms)."
"action": "Supply"
},
"remove": {
"title": "Remove Liquidity",
@ -68,7 +67,6 @@
}
},
"trade": {
"action": "Swap",
"warning": "Use at your own risk. Please familiarize yourself [with the risks](https://blog.oceanprotocol.com/on-staking-on-data-in-ocean-market-3d8e09eb0a13) and the [Terms of Use](/terms)."
"action": "Swap"
}
}

View File

@ -40,7 +40,6 @@ export default function Add({
const [amountMax, setAmountMax] = useState<string>()
const [newPoolTokens, setNewPoolTokens] = useState('0')
const [newPoolShare, setNewPoolShare] = useState('0')
const [isWarningAccepted, setIsWarningAccepted] = useState(false)
// Live validation rules
// https://github.com/jquense/yup#number
@ -143,37 +142,17 @@ export default function Add({
{({ isSubmitting, setSubmitting, submitForm, values, isValid }) => (
<>
<div className={styles.addInput}>
{isWarningAccepted ? (
<FormAdd
amountMax={amountMax}
setNewPoolTokens={setNewPoolTokens}
setNewPoolShare={setNewPoolShare}
/>
) : (
content.pool.add.warning && (
<Alert
className={styles.warning}
text={content.pool.add.warning.toString()}
state="info"
action={{
name: 'I understand',
style: 'text',
handleAction: () => setIsWarningAccepted(true)
}}
/>
)
)}
<FormAdd
amountMax={amountMax}
setNewPoolTokens={setNewPoolTokens}
setNewPoolShare={setNewPoolShare}
/>
</div>
<Output newPoolTokens={newPoolTokens} newPoolShare={newPoolShare} />
<Actions
isDisabled={
!isValid ||
!isWarningAccepted ||
!values.amount ||
values.amount === 0
}
isDisabled={!isValid || !values.amount || values.amount === 0}
isLoading={isSubmitting}
loaderMessage="Adding Liquidity..."
successMessage="Successfully added liquidity."

View File

@ -41,7 +41,6 @@ export default function FormTrade({
const [coinFrom, setCoinFrom] = useState<string>('OCEAN')
const [maximumBaseToken, setMaximumBaseToken] = useState('0')
const [maximumDt, setMaximumDt] = useState('0')
const [isWarningAccepted, setIsWarningAccepted] = useState(false)
const validationSchema: Yup.SchemaOf<FormTradeData> = Yup.object()
.shape({
@ -185,32 +184,17 @@ export default function FormTrade({
>
{({ isSubmitting, setSubmitting, submitForm, values, isValid }) => (
<>
{isWarningAccepted ? (
<Swap
asset={asset}
balance={balance}
setCoin={setCoinFrom}
setMaximumBaseToken={setMaximumBaseToken}
setMaximumDt={setMaximumDt}
isLoading={isSubmitting}
/>
) : (
<div className={styles.alertWrap}>
<Alert
text={content.trade.warning}
state="info"
action={{
name: 'I understand',
style: 'text',
handleAction: () => setIsWarningAccepted(true)
}}
/>
</div>
)}
<Swap
asset={asset}
balance={balance}
setCoin={setCoinFrom}
setMaximumBaseToken={setMaximumBaseToken}
setMaximumDt={setMaximumDt}
isLoading={isSubmitting}
/>
<Actions
isDisabled={
!isValid ||
!isWarningAccepted ||
!isAssetNetwork ||
values.datatoken === undefined ||
values.baseToken === undefined