feat(chat-room-bg): 배경 이미지 변경 기능 추가

This commit is contained in:
Yu Sung
2025-09-04 16:44:57 +09:00
parent a025e455a0
commit ee67e1eab7
10 changed files with 277 additions and 18 deletions

View File

@@ -249,7 +249,14 @@ struct ChatRoomView: View {
}
if viewModel.isShowingChangeBgView {
ChatBgSelectionView()
ChatBgSelectionView(
characterId: viewModel.characterId,
selectedBgImageId: viewModel.chatRoomBgImageId,
onTapBgImage: {
viewModel.setBackgroundImage(imageItem: $0)
},
isShowing: $viewModel.isShowingChangeBgView
)
}
if viewModel.isShowingChatResetConfirmDialog {
@@ -325,19 +332,28 @@ struct ChatRoomBgView: View {
let url: String?
var body: some View {
ZStack {
if let url = url {
KFImage(URL(string: url))
.resizable()
.aspectRatio(4/5, contentMode: .fill)
.frame(maxWidth: screenSize().width)
GeometryReader { geo in
let width = geo.size.width
let height = width * 5 / 4
ZStack {
if let url = url {
KFImage(URL(string: url))
.resizable()
.scaledToFill()
.frame(width: width, height: height)
.clipped()
.ignoresSafeArea()
}
Color.black
.opacity(0.6)
.ignoresSafeArea()
}
Color.black
.opacity(0.6)
.ignoresSafeArea()
.frame(width: width, height: height)
.clipped()
}
.aspectRatio(4/5, contentMode: .fit)
}
}