From b376d4f4829ac001463302dcc317c9fd70b3f17c Mon Sep 17 00:00:00 2001 From: John Huang Date: Fri, 5 Apr 2024 10:32:58 -0700 Subject: [PATCH] move modifier to param --- .../DydxTradeInputMarginModeView.kt | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/v4/feature/trade/src/main/java/exchange/dydx/trading/feature/trade/tradeinput/DydxTradeInputMarginModeView.kt b/v4/feature/trade/src/main/java/exchange/dydx/trading/feature/trade/tradeinput/DydxTradeInputMarginModeView.kt index 75079ce8..f5401ace 100644 --- a/v4/feature/trade/src/main/java/exchange/dydx/trading/feature/trade/tradeinput/DydxTradeInputMarginModeView.kt +++ b/v4/feature/trade/src/main/java/exchange/dydx/trading/feature/trade/tradeinput/DydxTradeInputMarginModeView.kt @@ -107,20 +107,30 @@ object DydxTradeInputMarginModeView : DydxComponent { .fillMaxSize() .themeColor(ThemeColor.SemanticColor.layer_4), ) { - MarginModeViewHeader(state) + MarginModeViewHeader( + modifier = Modifier, + state = state, + ) PlatformDivider() - Selection(state.crossMargin) + Selection( + modifier = Modifier, + marginModeState = state.crossMargin, + ) Spacer(modifier = Modifier.height(8.dp)) - Selection(state.isolatedMargin) + Selection( + modifier = Modifier, + marginModeState = state.isolatedMargin, + ) } } @Composable fun MarginModeViewHeader( + modifier: Modifier, state: ViewState, ) { Row( - modifier = Modifier + modifier = modifier .fillMaxWidth() .padding(vertical = 8.dp), verticalAlignment = Alignment.CenterVertically, @@ -156,10 +166,13 @@ object DydxTradeInputMarginModeView : DydxComponent { } @Composable - fun Selection(marginModeState: MarginTypeSelection) { + fun Selection( + modifier: Modifier, + marginModeState: MarginTypeSelection + ) { val shape = RoundedCornerShape(10.dp) Row( - modifier = Modifier + modifier = modifier .padding( horizontal = ThemeShapes.HorizontalPadding, vertical = ThemeShapes.VerticalPadding,