Skip to content

Commit

Permalink
[fix/#841] delete dialog StringResources
Browse files Browse the repository at this point in the history
  • Loading branch information
leeeyubin committed Sep 25, 2024
1 parent c41961b commit 8d76b7b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
package org.sopt.official.feature.mypage.component

import androidx.annotation.StringRes
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -38,7 +37,6 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -50,15 +48,14 @@ import org.sopt.official.designsystem.Gray600
import org.sopt.official.designsystem.Gray700
import org.sopt.official.designsystem.SoptTheme
import org.sopt.official.designsystem.White
import org.sopt.official.feature.mypage.R

@Composable
fun MyPageDialog(
onDismissRequest: () -> Unit,
@StringRes title: Int,
@StringRes subTitle: Int,
@StringRes negativeText: Int,
@StringRes positiveText: Int,
title: String,
subTitle: String,
negativeText: String,
positiveText: String,
modifier: Modifier = Modifier,
properties: DialogProperties = DialogProperties(usePlatformDefaultWidth = false),
onPositiveButtonClick: () -> Unit = {}
Expand All @@ -78,13 +75,13 @@ fun MyPageDialog(
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
text = stringResource(id = title),
text = title,
color = White,
style = SoptTheme.typography.heading16B
)
Spacer(modifier = Modifier.height(28.dp))
Text(
text = stringResource(id = subTitle),
text = subTitle,
color = Gray100,
style = SoptTheme.typography.body14M,
textAlign = TextAlign.Center,
Expand All @@ -104,7 +101,7 @@ fun MyPageDialog(
contentColor = Gray10,
) {
Text(
text = stringResource(negativeText),
text = negativeText,
style = SoptTheme.typography.body14M
)
}
Expand All @@ -114,7 +111,7 @@ fun MyPageDialog(
onClick = onPositiveButtonClick,
) {
Text(
text = stringResource(positiveText),
text = positiveText,
style = SoptTheme.typography.body14M
)
}
Expand All @@ -129,10 +126,10 @@ fun MyPageDialogPreview() {
SoptTheme {
MyPageDialog(
onDismissRequest = {},
title = R.string.mypage_alert_soptamp_reset_title,
subTitle = R.string.mypage_alert_soptamp_reset_subtitle,
negativeText = R.string.mypage_alert_soptamp_reset_negative,
positiveText = R.string.mypage_alert_soptamp_reset_positive
title = "미션을 초기화 하실건가요?",
subTitle = "사진, 메모가 삭제되고\n전체 미션이 미완료상태로 초기화됩니다.",
negativeText = "취소",
positiveText = "초기화"
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import org.sopt.official.auth.model.UserActiveState
import org.sopt.official.common.navigator.NavigatorProvider
import org.sopt.official.common.util.serializableExtra
import org.sopt.official.designsystem.SoptTheme
import org.sopt.official.feature.mypage.R
import org.sopt.official.feature.mypage.component.MyPageDialog
import org.sopt.official.feature.mypage.component.MyPageSection
import org.sopt.official.feature.mypage.component.MyPageTopBar
Expand Down Expand Up @@ -249,21 +248,21 @@ private fun ShowMyPageDialog(
MyPageAction.CLEAR_SOPTAMP -> {
MyPageDialog(
onDismissRequest = onDismissRequest,
title = R.string.mypage_alert_soptamp_reset_title,
subTitle = R.string.mypage_alert_soptamp_reset_subtitle,
negativeText = R.string.mypage_alert_soptamp_reset_negative,
positiveText = R.string.mypage_alert_soptamp_reset_positive,
title = "미션을 초기화 하실건가요?",
subTitle = "사진, 메모가 삭제되고\n전체 미션이 미완료상태로 초기화됩니다.",
negativeText = "취소",
positiveText = "초기화",
onPositiveButtonClick = onClearSoptampClick
)
}

MyPageAction.LOGOUT -> {
MyPageDialog(
onDismissRequest = onDismissRequest,
title = R.string.mypage_alert_log_out_title,
subTitle = R.string.mypage_alert_log_out_subtitle,
negativeText = R.string.mypage_alert_log_out_negative,
positiveText = R.string.mypage_alert_log_out_positive,
title = "로그아웃",
subTitle = "정말 로그아웃을 하실 건가요?",
negativeText = "취소",
positiveText = "로그아웃",
onPositiveButtonClick = onLogoutClick
)
}
Expand Down
8 changes: 0 additions & 8 deletions feature/mypage/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@
<!-- mypage -->
<string name="toolbar_mypage">마이페이지</string>
<string name="mypage_change_nickname">닉네임 변경</string>
<string name="mypage_alert_soptamp_reset_title">미션을 초기화 하실건가요?</string>
<string name="mypage_alert_soptamp_reset_subtitle">사진, 메모가 삭제되고\n전체 미션이 미완료상태로 초기화됩니다.</string>
<string name="mypage_alert_soptamp_reset_positive">초기화</string>
<string name="mypage_alert_soptamp_reset_negative">취소</string>
<string name="mypage_alert_log_out_title">로그아웃</string>
<string name="mypage_alert_log_out_subtitle">정말 로그아웃을 하실 건가요?</string>
<string name="mypage_alert_log_out_positive">로그아웃</string>
<string name="mypage_alert_log_out_negative">취소</string>

<!-- 탈퇴하기 -->
<string name="toolbar_sign_out">탈퇴하기</string>
Expand Down

0 comments on commit 8d76b7b

Please sign in to comment.