Skip to content

Commit

Permalink
move modifier to param
Browse files Browse the repository at this point in the history
  • Loading branch information
johnqh committed Apr 5, 2024
1 parent 85ca870 commit b376d4f
Showing 1 changed file with 19 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b376d4f

Please sign in to comment.