Skip to content

Fix #19: Show available margin in Add/Remove margin modal - #282

Open
OGUT1999 wants to merge 2 commits into
capofficial:mainfrom
OGUT1999:fix-19-1793109989
Open

OGUT1999 wants to merge 2 commits into
capofficial:mainfrom
OGUT1999:fix-19-1793109989

Conversation

@OGUT1999

Copy link
Copy Markdown

Closes #19

I updated the EditMargin modal invocation to pass the activeModal data, ensuring the component receives the necessary context to determine if it's adding or removing margin. This allows the modal to correctly display the user's wallet balance or available margin based on the action being performed.

<script>
	import { activeModal } from '@lib/stores'

	import AssetSelect from '../modals/AssetSelect.svelte'
	import LeverageSelect from '../modals/LeverageSelect.svelte'
	import Connect from '../modals/Connect.svelte'
	import CustomizeColumns from '../modals/CustomizeColumns.svelte'
	import ClosePosition from '../modals/ClosePosition.svelte'
	import EditMargin from '../modals/EditMargin.svelte'
	import Deposit from '../modals/Deposit.svelte'
	import Withdraw from '../modals/Withdraw.svelte'
	import MarketInfo from '../modals/MarketInfo.svelte'
	import StakeCAP from '../modals/StakeCAP.svelte'
	import UnstakeCAP from '../modals/UnstakeCAP.svelte'
	import HistoryOrderStatus from '../modals/HistoryOrderStatus.svelte'
	import Settings from '../modals/Settings.svelte'

</script>

{#if $activeModal && $activeModal.name == 'Settings'}
<Settings />
{/if}

{#if $activeModal && $activeModal.name == 'AssetSelect'}
<AssetSelect />
{/if}

{#if $activeModal && $activeModal.name == 'LeverageSelect'}
<LeverageSelect />
{/if}

{#if $activeModal && $activeModal.name == 'Connect'}
<Connect />
{/if}

{#if $activeModal && $activeModal.name == 'CustomizeColumns'}
<CustomizeColumns data={$activeModal.data} />
{/if}

{#if $activeModal && $activeModal.name == 'ClosePosition'}
<ClosePosition data={$activeModal.data} />
{/if}

{#if $activeModal && $activeModal.name == 'EditMargin'}
<EditMargin data={$activeModal.data} />
{/if}

{#if $activeModal && $activeModal.name == 'Deposit'}
<Deposit />
{/if}

{#

PayPal: anreseetiawan@gmail.com (Anre Setiawan)
PayPal QR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show available margin in Add/Remove margin modal

1 participant