Skip to content

Commit

Permalink
[FEAT/#15] 루트에 따라 TopAppBar 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Jul 6, 2024
1 parent 3b15164 commit 2b42794
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.terning.feature.component.topappbar

import androidx.compose.foundation.layout.Row
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
Expand All @@ -24,7 +23,7 @@ fun MyPageTopAppBar() {
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = "프로필 수정",
text = stringResource(id = R.string.my_page_top_app_bar),
style = TerningTypography().button3,
textAlign = TextAlign.Center
)
Expand Down
12 changes: 10 additions & 2 deletions feature/src/main/java/com/terning/feature/main/MainScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import com.terning.core.designsystem.theme.Grey300
import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.White
import com.terning.feature.calendar.navigation.calendarNavGraph
import com.terning.feature.component.topappbar.BackButtonTopAppBar
import com.terning.feature.component.topappbar.LogoTopAppBar
import com.terning.feature.component.topappbar.MyPageTopAppBar
import com.terning.feature.component.topappbar.TerningTopAppBar
import com.terning.feature.home.navigation.homeNavGraph
import com.terning.feature.mypage.navigation.myPageNavGraph
import com.terning.feature.search.navigation.searchNavGraph
Expand All @@ -36,7 +36,15 @@ fun MainScreen(
navigator: MainNavigator = rememberMainNavigator(),
) {
Scaffold(
topBar = { MyPageTopAppBar() },
topBar = {
when (navigator.currentTab) {
MainTab.HOME -> LogoTopAppBar()
MainTab.CALENDAR -> TerningTopAppBar()
MainTab.SEARCH -> LogoTopAppBar()
MainTab.MY_PAGE -> MyPageTopAppBar()
null -> LogoTopAppBar()
}
},
bottomBar = {
MainBottomBar(
isVisible = navigator.showBottomBar(),
Expand Down
3 changes: 3 additions & 0 deletions feature/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@
<string name="ic_back">뒤로가기 버튼</string>
<string name="ic_logo">탑 바 로고</string>
<string name="ic_20_right">오른쪽 버튼</string>

<!-- MyPage-->
<string name="my_page_top_app_bar">프로필 수정</string>
</resources>

0 comments on commit 2b42794

Please sign in to comment.