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

[HOTFIX/#96] 차단 바텀시트 닉네임 추가 #98

Merged
merged 1 commit into from
Jan 24, 2025
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
@@ -1,5 +1,6 @@
package com.sopt.withsuhyeon.core.component.bottomsheet

import android.provider.ContactsContract.CommonDataKinds.Nickname
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -36,6 +37,7 @@ import com.sopt.withsuhyeon.ui.theme.WithSuhyeonTheme.typography
fun BlockBottomSheet(
closeSheet: () -> Unit,
navigateToBlockScreen: () -> Unit,
nickname: String,
modifier: Modifier = Modifier,
) {
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
Expand Down Expand Up @@ -82,7 +84,7 @@ fun BlockBottomSheet(
)
Text(
modifier = Modifier.fillMaxWidth(),
text = stringResource(R.string.block_bottomsheet_sub_title),
text = "차단한 사용자는 ${nickname}님의 게시글을 볼 수 없어요",
style = typography.body03_SB,
color = colors.Grey500
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.sopt.withsuhyeon.data.dto.response

import android.provider.ContactsContract.CommonDataKinds.Nickname
import com.sopt.withsuhyeon.domain.entity.HomePostItemModel
import kotlinx.serialization.Serializable

@Serializable
data class ResponseHomeDto(
val count: Int,
val region: String,
val homePosts: List<HomePostItemModel>
val homePosts: List<HomePostItemModel>,
val nickname: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ fun ResponseHomeDto.toHomeModel(): HomeModel {
count = this.count,
region = this.region,
homePosts = this.homePosts,
nickname = this.nickname
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ package com.sopt.withsuhyeon.domain.entity
data class HomeModel(
val count: Int,
val region: String,
val homePosts: List<HomePostItemModel>
val homePosts: List<HomePostItemModel>,
val nickname: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ fun HomeScreen(
navigateToBlockUser: () -> Unit
) {
var isBlockBottomSheetVisible by rememberSaveable { mutableStateOf(true) }
val homeState by viewModel.state.collectAsStateWithLifecycle()

if (isBlockBottomSheetVisible) {
BlockBottomSheet(
closeSheet = { isBlockBottomSheetVisible = false },
navigateToBlockScreen = navigateToBlockUser
navigateToBlockScreen = navigateToBlockUser,
nickname = homeState.homeData.nickname
)
}

val homeState by viewModel.state.collectAsStateWithLifecycle()

val composition by rememberLottieComposition(
LottieCompositionSpec.RawRes(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package com.sopt.withsuhyeon.feature.home.state

import com.sopt.withsuhyeon.R
import com.sopt.withsuhyeon.core.util.KeyStorage.EMPTY_STRING
import com.sopt.withsuhyeon.domain.entity.HomeModel

data class HomeState(
val homeData: HomeModel = HomeModel(
count = 0,
region = "",
homePosts = emptyList()
homePosts = emptyList(),
nickname = EMPTY_STRING
),
val count: Int = 0,
val isRefreshing: Boolean = false,
val lottieResId: Int = R.raw.home,
val nickname: String = EMPTY_STRING
)
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@

<!-- 차단 바텀시트 -->
<string name="block_bottomsheet_title">차단하고 싶은 번호가 있나요?</string>
<string name="block_bottomsheet_sub_title">차단한 사용자는 [닉네임]님의 게시글을 볼 수 없어요</string>
<string name="block_bottomsheet_button_text">차단하러 가기</string>
<string name="block_bottomsheet_skip_text">괜찮아요</string>

Expand Down