Skip to content

Commit 392fdd7

Browse files
committed
refactor#129 : 리터럴 스트링 리소스 변경 처리
1 parent b04b0df commit 392fdd7

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

feature/profile/src/main/java/com/yapp/feature/profile/ProfileScreen.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ internal fun ProfileRoute(
6262

6363
if (uiState.showLogoutDialog) {
6464
YappAlertDialog(
65-
title = "로그아웃 할까요?",
66-
actionButtonText = "아니요!",
67-
recommendActionButtonText = "로그아웃",
65+
title = stringResource(R.string.profile_logout_title),
66+
actionButtonText = stringResource(R.string.profile_logout_action_button),
67+
recommendActionButtonText = stringResource(R.string.profile_logout_recommend_button),
6868
onDismissRequest = { viewModel.store.onIntent(ProfileIntent.OnDismissLogout) },
6969
onActionButtonClick = { viewModel.store.onIntent(ProfileIntent.OnCancelLogout) },
7070
onRecommendActionButtonClick = { viewModel.store.onIntent(ProfileIntent.OnLaunchedLogout) },
@@ -118,7 +118,7 @@ private fun ProfileScreen(
118118
Spacer(modifier = Modifier.height(12.dp))
119119
ProfileSectionItem(
120120
onClickItem = onClickAttendHistory,
121-
title = "출석내역",
121+
title = stringResource(R.string.profile_attend_title),
122122
slot = {
123123
Icon(
124124
painter = painterResource(id = com.yapp.core.designsystem.R.drawable.icon_chevron_right),
@@ -129,7 +129,7 @@ private fun ProfileScreen(
129129
)
130130
ProfileSectionItem(
131131
onClickItem = onClickPreviousHistory,
132-
title = "이전 활동 내역",
132+
title = stringResource(R.string.profile_previous_history),
133133
slot = {
134134
Icon(
135135
painter = painterResource(id = com.yapp.core.designsystem.R.drawable.icon_chevron_right),
@@ -140,7 +140,7 @@ private fun ProfileScreen(
140140
)
141141
ProfileSectionItem(
142142
onClickItem = onClickQuestion,
143-
title = "이용문의",
143+
title = stringResource(R.string.profile_question_title),
144144
slot = {
145145
Icon(
146146
painter = painterResource(id = com.yapp.core.designsystem.R.drawable.icon_chevron_right),
@@ -151,13 +151,13 @@ private fun ProfileScreen(
151151
)
152152
ProfileSectionItem(
153153
onClickItem = onClickWithdraw,
154-
title = "회원탈퇴"
154+
title = stringResource(R.string.profile_withdraw_title)
155155
)
156156
}
157157
Column {
158158
YappOutlinedSecondaryButtonLarge(
159159
modifier = Modifier.fillMaxWidth().padding(start = 16.dp, end = 16.dp, bottom = 8.dp),
160-
text = "로그아웃",
160+
text = stringResource(R.string.profile_logout_button),
161161
onClick = onCLickLogout
162162
)
163163
}

feature/profile/src/main/java/com/yapp/feature/profile/component/ProfileTopBarSection.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import androidx.compose.runtime.Composable
88
import androidx.compose.ui.Alignment
99
import androidx.compose.ui.Modifier
1010
import androidx.compose.ui.res.painterResource
11+
import androidx.compose.ui.res.stringResource
1112
import androidx.compose.ui.tooling.preview.Preview
12-
import com.yapp.core.designsystem.R
13+
import com.yapp.core.designsystem.R as coreDesignR
1314
import com.yapp.core.designsystem.extension.yappClickable
15+
import com.yapp.feature.profile.R
1416

1517
@Composable
1618
internal fun ProfileTopBarSection(
@@ -21,10 +23,10 @@ internal fun ProfileTopBarSection(
2123
modifier = modifier.fillMaxWidth(),
2224
verticalAlignment = Alignment.CenterVertically
2325
) {
24-
Text(modifier = Modifier.weight(1f), text = "마이페이지")
26+
Text(modifier = Modifier.weight(1f), text = stringResource(R.string.profile_title))
2527
Icon(
2628
modifier = Modifier.yappClickable(onClick = onClickSettings),
27-
painter = painterResource(R.drawable.icon_setting),
29+
painter = painterResource(coreDesignR.drawable.icon_setting),
2830
contentDescription = "setting"
2931
)
3032
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="profile_title">마이페이지</string>
4+
<string name="profile_logout_title">로그아웃 할까요?</string>
5+
<string name="profile_logout_action_button">아니요!</string>
6+
<string name="profile_logout_recommend_button">로그아웃</string>
7+
<string name="profile_attend_title">출석내역</string>
8+
<string name="profile_previous_history">이전 활동 내역</string>
9+
<string name="profile_question_title">이용문의</string>
10+
<string name="profile_withdraw_title">회원탈퇴</string>
11+
<string name="profile_logout_button">로그아웃</string>
12+
</resources>

0 commit comments

Comments
 (0)