feat(creator-channel): 프로필 이미지 표시 방식 변경 및 UI 표시 순서 변경
This commit is contained in:
21
SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/Contents.json
vendored
Normal file
21
SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"filename" : "ic_new_share.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/ic_new_share.png
vendored
Normal file
BIN
SodaLive/Resources/Assets.xcassets/ic_new_share.imageset/ic_new_share.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 408 B |
@@ -139,7 +139,6 @@ struct UserProfileCreatorView: View {
|
|||||||
.padding(20)
|
.padding(20)
|
||||||
.background(Color(hex: "222222"))
|
.background(Color(hex: "222222"))
|
||||||
.cornerRadius(16.7)
|
.cornerRadius(16.7)
|
||||||
.padding(.top, 20)
|
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import Kingfisher
|
||||||
|
|
||||||
struct UserProfileView: View {
|
struct UserProfileView: View {
|
||||||
|
|
||||||
@@ -25,135 +26,19 @@ struct UserProfileView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
GeometryReader { proxy in
|
GeometryReader { proxy in
|
||||||
BaseView(isLoading: $viewModel.isLoading) {
|
BaseView(isLoading: $viewModel.isLoading) {
|
||||||
|
ZStack(alignment: .top) {
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
HStack(spacing: 0) {
|
|
||||||
Button {
|
|
||||||
if presentationMode.wrappedValue.isPresented {
|
|
||||||
presentationMode.wrappedValue.dismiss()
|
|
||||||
} else {
|
|
||||||
AppState.shared.back()
|
|
||||||
}
|
|
||||||
} label: {
|
|
||||||
Image("ic_back")
|
|
||||||
.resizable()
|
|
||||||
.frame(width: 20, height: 20)
|
|
||||||
|
|
||||||
Text(viewModel.navigationTitle)
|
|
||||||
.font(.custom(Font.bold.rawValue, size: 18.3))
|
|
||||||
.foregroundColor(Color(hex: "eeeeee"))
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer()
|
|
||||||
|
|
||||||
if userId != UserDefaults.int(forKey: .userId) {
|
|
||||||
Image("ic_seemore_vertical")
|
|
||||||
.onTapGesture {
|
|
||||||
viewModel.isShowReportMenu = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
.frame(height: 50)
|
|
||||||
.background(Color.black)
|
|
||||||
|
|
||||||
ScrollView(.vertical, showsIndicators: false) {
|
ScrollView(.vertical, showsIndicators: false) {
|
||||||
VStack(spacing: 0) {
|
LazyVStack(spacing: 48) {
|
||||||
if let creatorProfile = viewModel.creatorProfile {
|
if let creatorProfile = viewModel.creatorProfile {
|
||||||
VStack(spacing: 0) {
|
ZStack(alignment: .bottomLeading) {
|
||||||
UserProfileCreatorView(creator: creatorProfile.creator, isCreator: creatorProfile.isCreatorRole) {
|
KFImage(URL(string: creatorProfile.creator.profileUrl))
|
||||||
viewModel.creatorFollow()
|
.cancelOnDisappear(true)
|
||||||
} showCreatorFollowNotifyDialog: {
|
.downsampling(size: CGSize(width: screenSize().width, height: screenSize().width))
|
||||||
isShowFollowNotifyDialog = true
|
.resizable()
|
||||||
} shareChannel: {
|
.aspectRatio(1, contentMode: .fill)
|
||||||
viewModel.shareChannel(
|
.frame(maxWidth: screenSize().width)
|
||||||
userId: creatorProfile.creator.creatorId,
|
.clipped()
|
||||||
nickname: creatorProfile.creator.nickname,
|
|
||||||
profileImage: creatorProfile.creator.profileUrl
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if creatorProfile.isCreatorRole {
|
|
||||||
if viewModel.communityPostList.count > 0 {
|
|
||||||
ScrollView(.horizontal, showsIndicators: false) {
|
|
||||||
LazyHStack(spacing: 13.3) {
|
|
||||||
if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
|
|
||||||
CreatorCommunityWriteItemView()
|
|
||||||
.onTapGesture {
|
|
||||||
AppState.shared.setAppStep(
|
|
||||||
step: .creatorCommunityWrite(
|
|
||||||
onSuccess: creatorCommunityWriteSuccess
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ForEach(0..<viewModel.communityPostList.count, id: \.self) { index in
|
|
||||||
let item = viewModel.communityPostList[index]
|
|
||||||
CreatorCommunityItemView(item: item)
|
|
||||||
.frame(width: 320)
|
|
||||||
.onTapGesture {
|
|
||||||
AppState.shared
|
|
||||||
.setAppStep(
|
|
||||||
step: .creatorCommunityAll(creatorId: userId)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
.background(
|
|
||||||
GeometryReader { geo in
|
|
||||||
Color.clear
|
|
||||||
.preference(key: HeightPreferenceKey.self, value: geo.size.height)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
CreatorCommunityMoreItemView {
|
|
||||||
AppState.shared
|
|
||||||
.setAppStep(
|
|
||||||
step: .creatorCommunityAll(creatorId: userId)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
.frame(height: maxCommunityPostHeight)
|
|
||||||
.onPreferenceChange(HeightPreferenceKey.self) { value in
|
|
||||||
if let current = maxCommunityPostHeight {
|
|
||||||
maxCommunityPostHeight = max(current, value)
|
|
||||||
} else {
|
|
||||||
maxCommunityPostHeight = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.padding(.top, 26.7)
|
|
||||||
} else {
|
|
||||||
if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
|
|
||||||
CreatorCommunityNoPostsItemView(
|
|
||||||
onSuccess: creatorCommunityWriteSuccess
|
|
||||||
)
|
|
||||||
.padding(.top, 26.7)
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if creatorProfile.isCreatorRole {
|
|
||||||
if !creatorProfile.seriesList.isEmpty {
|
|
||||||
UserProfileSeriesView(
|
|
||||||
creatorId: creatorProfile.creator.creatorId,
|
|
||||||
items: creatorProfile.seriesList
|
|
||||||
)
|
|
||||||
.padding(.top, 26.7)
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
}
|
|
||||||
|
|
||||||
if creatorProfile.contentList.count > 0 ||
|
|
||||||
userId == UserDefaults.int(forKey: .userId)
|
|
||||||
{
|
|
||||||
UserProfileContentView(
|
|
||||||
userId: userId,
|
|
||||||
items: creatorProfile.contentList
|
|
||||||
)
|
|
||||||
.padding(.top, 26.7)
|
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) || creatorProfile.liveRoomList.count > 0 {
|
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) || creatorProfile.liveRoomList.count > 0 {
|
||||||
@@ -210,21 +95,81 @@ struct UserProfileView: View {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.top, 26.7)
|
}
|
||||||
|
|
||||||
|
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) || creatorProfile.contentList.count > 0 {
|
||||||
|
UserProfileContentView(
|
||||||
|
userId: userId,
|
||||||
|
items: creatorProfile.contentList
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if viewModel.communityPostList.count > 0 {
|
||||||
|
ScrollView(.horizontal, showsIndicators: false) {
|
||||||
|
LazyHStack(spacing: 13.3) {
|
||||||
|
if UserDefaults.int(forKey: .userId) == creatorProfile.creator.creatorId {
|
||||||
|
CreatorCommunityWriteItemView()
|
||||||
|
.onTapGesture {
|
||||||
|
AppState.shared.setAppStep(
|
||||||
|
step: .creatorCommunityWrite(
|
||||||
|
onSuccess: creatorCommunityWriteSuccess
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ForEach(0..<viewModel.communityPostList.count, id: \.self) { index in
|
||||||
|
let item = viewModel.communityPostList[index]
|
||||||
|
CreatorCommunityItemView(item: item)
|
||||||
|
.frame(width: 320)
|
||||||
|
.onTapGesture {
|
||||||
|
AppState.shared
|
||||||
|
.setAppStep(
|
||||||
|
step: .creatorCommunityAll(creatorId: userId)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
.background(
|
||||||
|
GeometryReader { geo in
|
||||||
|
Color.clear
|
||||||
|
.preference(key: HeightPreferenceKey.self, value: geo.size.height)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
CreatorCommunityMoreItemView {
|
||||||
|
AppState.shared
|
||||||
|
.setAppStep(
|
||||||
|
step: .creatorCommunityAll(creatorId: userId)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
.padding(.horizontal, 13.3)
|
.padding(.horizontal, 13.3)
|
||||||
|
.frame(height: maxCommunityPostHeight)
|
||||||
|
.onPreferenceChange(HeightPreferenceKey.self) { value in
|
||||||
|
if let current = maxCommunityPostHeight {
|
||||||
|
maxCommunityPostHeight = max(current, value)
|
||||||
|
} else {
|
||||||
|
maxCommunityPostHeight = value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if creatorProfile.creator.creatorId == UserDefaults.int(forKey: .userId) {
|
||||||
|
CreatorCommunityNoPostsItemView(
|
||||||
|
onSuccess: creatorCommunityWriteSuccess
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !creatorProfile.seriesList.isEmpty {
|
||||||
|
UserProfileSeriesView(
|
||||||
|
creatorId: creatorProfile.creator.creatorId,
|
||||||
|
items: creatorProfile.seriesList
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if creatorProfile.userDonationRanking.count > 0 {
|
if creatorProfile.userDonationRanking.count > 0 {
|
||||||
VStack(spacing: 26.7) {
|
|
||||||
UserProfileDonationView(userId: userId, donationRankingResponse: creatorProfile.userDonationRanking)
|
UserProfileDonationView(userId: userId, donationRankingResponse: creatorProfile.userDonationRanking)
|
||||||
.padding(.horizontal, 13.3)
|
|
||||||
|
|
||||||
Rectangle()
|
|
||||||
.frame(height: 6.7)
|
|
||||||
.foregroundColor(Color.gray90.opacity(0.5))
|
|
||||||
}
|
|
||||||
.padding(.top, 26.7)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UserProfileFanTalkView(
|
UserProfileFanTalkView(
|
||||||
@@ -248,27 +193,55 @@ struct UserProfileView: View {
|
|||||||
},
|
},
|
||||||
isLoading: $viewModel.isLoading
|
isLoading: $viewModel.isLoading
|
||||||
)
|
)
|
||||||
.padding(.top, 26.7)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle("")
|
|
||||||
.navigationBarBackButtonHidden()
|
HStack(spacing: 14) {
|
||||||
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
|
Button {
|
||||||
HStack {
|
if presentationMode.wrappedValue.isPresented {
|
||||||
Spacer()
|
presentationMode.wrappedValue.dismiss()
|
||||||
Text(viewModel.errorMessage)
|
} else {
|
||||||
.padding(.vertical, 13.3)
|
AppState.shared.back()
|
||||||
.frame(width: screenSize().width - 66.7, alignment: .center)
|
}
|
||||||
.font(.custom(Font.medium.rawValue, size: 12))
|
} label: {
|
||||||
.background(Color.button)
|
Image("ic_back")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 20, height: 20)
|
||||||
|
|
||||||
|
Text(viewModel.navigationTitle)
|
||||||
|
.font(.custom(Font.preBold.rawValue, size: 20))
|
||||||
.foregroundColor(Color.white)
|
.foregroundColor(Color.white)
|
||||||
.multilineTextAlignment(.leading)
|
|
||||||
.cornerRadius(20)
|
|
||||||
.padding(.bottom, 66.7)
|
|
||||||
Spacer()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
if let creatorProfile = viewModel.creatorProfile {
|
||||||
|
Image("ic_new_share")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 24, height: 24)
|
||||||
|
.onTapGesture {
|
||||||
|
viewModel.shareChannel(
|
||||||
|
userId: creatorProfile.creator.creatorId,
|
||||||
|
nickname: creatorProfile.creator.nickname,
|
||||||
|
profileImage: creatorProfile.creator.profileUrl
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if userId != UserDefaults.int(forKey: .userId) {
|
||||||
|
Image("ic_seemore_vertical")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 24, height: 24)
|
||||||
|
.onTapGesture {
|
||||||
|
viewModel.isShowReportMenu = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.padding(.top, proxy.safeAreaInsets.top)
|
||||||
|
.padding(.horizontal, 24)
|
||||||
|
.frame(height: proxy.safeAreaInsets.top + 50)
|
||||||
}
|
}
|
||||||
|
|
||||||
ZStack {
|
ZStack {
|
||||||
@@ -337,8 +310,7 @@ struct UserProfileView: View {
|
|||||||
.ignoresSafeArea()
|
.ignoresSafeArea()
|
||||||
}
|
}
|
||||||
|
|
||||||
if let creatorProfile = viewModel.creatorProfile,
|
if let creatorProfile = viewModel.creatorProfile, viewModel.isShowUesrBlockConfirm {
|
||||||
viewModel.isShowUesrBlockConfirm {
|
|
||||||
UserBlockConfirmDialogView(
|
UserBlockConfirmDialogView(
|
||||||
isShowing: $viewModel.isShowUesrBlockConfirm,
|
isShowing: $viewModel.isShowUesrBlockConfirm,
|
||||||
nickname: creatorProfile.creator.nickname,
|
nickname: creatorProfile.creator.nickname,
|
||||||
@@ -369,6 +341,7 @@ struct UserProfileView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZStack {
|
||||||
if isShowFollowNotifyDialog {
|
if isShowFollowNotifyDialog {
|
||||||
CreatorFollowNotifyDialog(
|
CreatorFollowNotifyDialog(
|
||||||
isShowing: $isShowFollowNotifyDialog,
|
isShowing: $isShowFollowNotifyDialog,
|
||||||
@@ -395,6 +368,25 @@ struct UserProfileView: View {
|
|||||||
MenuSettingsView(isShowing: $isShowMenuSettings)
|
MenuSettingsView(isShowing: $isShowMenuSettings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.navigationTitle("")
|
||||||
|
.navigationBarBackButtonHidden()
|
||||||
|
.popup(isPresented: $viewModel.isShowPopup, type: .toast, position: .bottom, autohideIn: 2) {
|
||||||
|
HStack {
|
||||||
|
Spacer()
|
||||||
|
Text(viewModel.errorMessage)
|
||||||
|
.padding(.vertical, 13.3)
|
||||||
|
.frame(width: screenSize().width - 66.7, alignment: .center)
|
||||||
|
.font(.custom(Font.medium.rawValue, size: 12))
|
||||||
|
.background(Color.button)
|
||||||
|
.foregroundColor(Color.white)
|
||||||
|
.multilineTextAlignment(.leading)
|
||||||
|
.cornerRadius(20)
|
||||||
|
.padding(.bottom, 66.7)
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ignoresSafeArea()
|
||||||
.sheet(
|
.sheet(
|
||||||
isPresented: $viewModel.isShowShareView,
|
isPresented: $viewModel.isShowShareView,
|
||||||
onDismiss: { viewModel.shareMessage = "" },
|
onDismiss: { viewModel.shareMessage = "" },
|
||||||
|
|||||||
Reference in New Issue
Block a user