From 6266cda10e00f13744d309babf16b7c6106dbf8b Mon Sep 17 00:00:00 2001 From: Seunggu Kang Date: Wed, 27 Mar 2024 16:34:36 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20TopAppBar=EC=97=90=20=EA=B3=B5=EC=9C=A0?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/home/screen/DetailScreen.kt | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/feature/home/src/main/java/com/kusitms/connectdog/feature/home/screen/DetailScreen.kt b/feature/home/src/main/java/com/kusitms/connectdog/feature/home/screen/DetailScreen.kt index 94e0ca347..2e0696ea7 100644 --- a/feature/home/src/main/java/com/kusitms/connectdog/feature/home/screen/DetailScreen.kt +++ b/feature/home/src/main/java/com/kusitms/connectdog/feature/home/screen/DetailScreen.kt @@ -21,6 +21,8 @@ import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.Divider +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -75,11 +77,9 @@ fun DetailScreen( Scaffold( topBar = { - ConnectDogTopAppBar( - titleRes = null, - navigationType = TopAppBarNavigationType.BACK, - navigationIconContentDescription = "Navigation icon", - onNavigationClick = onBackClick + DetailTopAppBar( + onBackClick = onBackClick, + onShareClick = {} ) }, bottomBar = { @@ -114,6 +114,27 @@ fun DetailScreen( } } +@Composable +private fun DetailTopAppBar( + onBackClick: () -> Unit, + onShareClick: () -> Unit +) { + ConnectDogTopAppBar( + titleRes = null, + navigationType = TopAppBarNavigationType.BACK, + navigationIconContentDescription = "Navigation icon home", + onNavigationClick = onBackClick, + actionButtons = { + IconButton(onClick = onShareClick) { + Icon( + painter = painterResource(id = R.drawable.ic_share), + contentDescription = "Navigate to Search" + ) + } + } + ) +} + @Composable fun BookmarkButton( isBookmark: Boolean,