Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YDS-#248] Improve : SingleTopBar, DoubleTopBar 네비게이션 아이콘 넣을 수 있게 #249

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ private fun PreviewTopBarButton() {
onClick()
},
icon = R.drawable.ic_ground_filled,
isDisabled = false,
)
TopBarButton(
onClick = {
onClick()
},
icon = R.drawable.ic_ground_filled,
isDisabled = true,
)
}
Column(
Expand All @@ -113,14 +111,12 @@ private fun PreviewTopBarButton() {
onClick()
},
text = "닫기",
isDisabled = false,
)
TopBarButton(
onClick = {
onClick()
},
text = "닫기",
isDisabled = true,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,14 @@ private fun YdsScaffoldPreview() {
navigationIcon = {
TopBarButton(
icon = R.drawable.ic_arrow_left_line,
isDisabled = false,
)
},
actions = {
TopBarButton(
icon = R.drawable.ic_bell_line,
isDisabled = false,
)
TopBarButton(
icon = R.drawable.ic_search_line,
isDisabled = false,
onClick = {
scope.launch {
toastHostState.showToast(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,17 +320,14 @@ private fun PreviewNavigation() {
navigationIcon = {
TopBarButton(
icon = R.drawable.ic_arrow_left_line,
isDisabled = false,
)
},
actions = {
TopBarButton(
icon = R.drawable.ic_bell_line,
isDisabled = false,
)
TopBarButton(
icon = R.drawable.ic_search_line,
isDisabled = false,
onClick = { },
)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,47 @@ fun DoubleTitleTopBar(
modifier: Modifier = Modifier,
title: String = "",
subtitle: String = "",
navigationIcon: @Composable () -> Unit = {},
actions: @Composable RowScope.() -> Unit = {},
) {
TopAppBar(
modifier = modifier
.fillMaxWidth()
.height(72.dp),
contentPadding = PaddingValues(end = 4.dp)
contentPadding = PaddingValues(end = 4.dp),
) {
Box(
modifier = Modifier.fillMaxWidth()
modifier = Modifier.fillMaxWidth(),
) {

Column(
modifier = Modifier.padding(
start = 16.dp,
top = 12.dp,
end = 16.dp,
bottom = 8.dp
)
) {
YdsText(
text = subtitle,
style = YdsTheme.typography.body2,
color = YdsTheme.colors.textPrimary
)
YdsText(
text = title,
style = YdsTheme.typography.title2,
color = YdsTheme.colors.textPrimary
)
Row {
navigationIcon()
Column(
modifier = Modifier.padding(
start = 16.dp,
top = 12.dp,
end = 16.dp,
bottom = 8.dp,
)
) {
YdsText(
text = subtitle,
style = YdsTheme.typography.body2,
color = YdsTheme.colors.textPrimary,
)
YdsText(
text = title,
style = YdsTheme.typography.title2,
color = YdsTheme.colors.textPrimary,
)
}
}

Row(
modifier = Modifier
.padding(top = 16.dp)
.align(Alignment.BottomEnd),
verticalAlignment = Alignment.CenterVertically
verticalAlignment = Alignment.CenterVertically,
) {
actions()
}
Expand All @@ -77,20 +81,22 @@ private fun PreviewDoubleTitleTopBar() {
DoubleTitleTopBar(
title = "타이틀",
subtitle = "서브타이틀",
navigationIcon = {
TopBarButton(
icon = R.drawable.ic_arrow_left_line,
)
},
actions = {
TopBarButton(
icon = R.drawable.ic_ground_filled,
isDisabled = false
)
TopBarButton(
icon = R.drawable.ic_ground_filled,
isDisabled = false
)
TopBarButton(
icon = R.drawable.ic_ground_filled,
isDisabled = false
)
}
},
)
}
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ private fun PreviewSearchTopBar() {
navigationIcon = {
TopBarButton(
icon = R.drawable.ic_arrow_left_line,
isDisabled = false,
onClick = {
Toast.makeText(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,37 @@ import com.yourssu.design.system.compose.base.YdsText
fun SingleTitleTopBar(
modifier: Modifier = Modifier,
title: String = "",
navigationIcon: @Composable () -> Unit = {},
actions: @Composable RowScope.() -> Unit = {},
) {
TopAppBar(
modifier = modifier
.fillMaxWidth()
.height(56.dp),
contentPadding = PaddingValues(end = 4.dp)
contentPadding = PaddingValues(end = 4.dp),
) {
Box(
modifier = Modifier
.fillMaxWidth()
.fillMaxWidth(),
) {
YdsText(
modifier = Modifier
.padding(16.dp, 17.dp, 16.dp, 8.dp)
.wrapContentHeight(),
text = title,
style = YdsTheme.typography.title2,
color = YdsTheme.colors.textPrimary
)
Row {
navigationIcon()
YdsText(
modifier = Modifier
.padding(16.dp, 17.dp, 16.dp, 8.dp)
.wrapContentHeight(),
text = title,
style = YdsTheme.typography.title2,
color = YdsTheme.colors.textPrimary,
)
}

Row(
modifier = Modifier
.fillMaxHeight()
.padding(0.dp)
.align(Alignment.TopEnd),
verticalAlignment = Alignment.CenterVertically
verticalAlignment = Alignment.CenterVertically,
) {
actions()
}
Expand All @@ -66,20 +70,22 @@ private fun PreviewSingleTitleTopBar() {
topBar = {
SingleTitleTopBar(
title = "타이틀",
navigationIcon = {
TopBarButton(
icon = R.drawable.ic_arrow_left_line,
)
},
actions = {
TopBarButton(
icon = R.drawable.ic_ground_filled,
isDisabled = false
)
TopBarButton(
icon = R.drawable.ic_ground_filled,
isDisabled = false
)
TopBarButton(
icon = R.drawable.ic_ground_filled,
isDisabled = false
)
}
},
)
}
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,14 @@ private fun PreviewTopBar() {
navigationIcon = {
TopBarButton(
icon = R.drawable.ic_arrow_left_line,
isDisabled = false,
)
},
actions = {
TopBarButton(
icon = R.drawable.ic_bell_line,
isDisabled = false,
)
TopBarButton(
icon = R.drawable.ic_search_line,
isDisabled = false,
)
}
)
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
versionName=2.5.2
versionName=2.5.3
#자동 배포를 위해서 버전은 여기 한 군데에서 관리하면 된다
Loading