From 8dd3bb6e17f6b78ecb298731e126cc54a01c0240 Mon Sep 17 00:00:00 2001 From: tgyuu-An Date: Wed, 29 Nov 2023 22:58:24 +0900 Subject: [PATCH] =?UTF-8?q?[REFACTOR]=20#50=20:=20TopBar=20Row=20->=20Box?= =?UTF-8?q?=20=EB=A1=9C=20=EB=B3=80=EA=B2=BD,=20text=20=EA=B0=80=EC=9A=B4?= =?UTF-8?q?=EB=8D=B0=20=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/wap/designsystem/component/TopBar.kt | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/core/designsystem/src/main/java/com/wap/designsystem/component/TopBar.kt b/core/designsystem/src/main/java/com/wap/designsystem/component/TopBar.kt index 49f8dc1b..75840918 100644 --- a/core/designsystem/src/main/java/com/wap/designsystem/component/TopBar.kt +++ b/core/designsystem/src/main/java/com/wap/designsystem/component/TopBar.kt @@ -3,8 +3,7 @@ package com.wap.designsystem.component import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -35,38 +34,38 @@ fun WappTopBar( @DrawableRes leftButtonDrawableRes: Int = R.drawable.ic_back, @DrawableRes rightButtonDrawableRes: Int = R.drawable.ic_close, ) { - Row( + Box( modifier = modifier, - horizontalArrangement = Arrangement.SpaceBetween, - verticalAlignment = Alignment.CenterVertically, ) { if (showLeftButton) { Icon( - modifier = Modifier - .size(20.dp) - .clickable { onClickLeftButton() }, painter = painterResource(leftButtonDrawableRes), contentDescription = stringResource(leftButtonDescriptionRes), tint = WappTheme.colors.white, + modifier = Modifier + .size(20.dp) + .clickable { onClickLeftButton() } + .align(Alignment.CenterStart), ) } Text( text = stringResource(titleRes), textAlign = TextAlign.Center, - modifier = Modifier.weight(1f), style = WappTheme.typography.titleBold, color = WappTheme.colors.white, + modifier = Modifier.align(Alignment.Center), ) if (showRightButton) { Icon( - modifier = Modifier - .size(20.dp) - .clickable { onClickRightButton() }, painter = painterResource(rightButtonDrawableRes), contentDescription = stringResource(rightButtonDescriptionRes), tint = WappTheme.colors.white, + modifier = Modifier + .size(20.dp) + .clickable { onClickRightButton() } + .align(Alignment.CenterEnd), ) } }