feat(creator): 플로팅 액션 진입을 연결한다

This commit is contained in:
Yu Sung
2026-07-03 22:02:11 +09:00
parent 5059cd4a40
commit 0fa036f04d
9 changed files with 69 additions and 12 deletions

View File

@@ -62,7 +62,7 @@ enum AppStep {
case serviceCenter
case createContent
case createContent(onSuccess: (() -> Void)? = nil)
case modifyContent(contentId: Int)

View File

@@ -55,7 +55,7 @@ struct ContentListView: View {
.cornerRadius(5.3)
.padding(.top, 13.3)
.padding(.horizontal, 13.3)
.onTapGesture { AppState.shared.setAppStep(step: .createContent) }
.onTapGesture { AppState.shared.setAppStep(step: .createContent()) }
}
HStack(spacing: 13.3) {

View File

@@ -10,6 +10,7 @@ import Kingfisher
struct ContentCreateView: View {
@Environment(\.locale) private var locale
let onSuccess: (() -> Void)?
@StateObject var keyboardHandler = KeyboardHandler()
@StateObject private var viewModel = ContentCreateViewModel()
@@ -23,6 +24,10 @@ struct ContentCreateView: View {
@State private var isShowSelectThemeView = false
@State private var isShowSelectDateView = false
@State private var isShowSelectTimeView = false
init(onSuccess: (() -> Void)? = nil) {
self.onSuccess = onSuccess
}
var body: some View {
let normalizedCountryCode = UserDefaults
@@ -655,7 +660,10 @@ struct ContentCreateView: View {
title: I18n.CreateContent.uploadTitle,
desc: I18n.CreateContent.uploadDescription,
confirmButtonTitle: I18n.Common.confirm,
confirmButtonAction: { AppState.shared.back() },
confirmButtonAction: {
onSuccess?()
AppState.shared.back()
},
cancelButtonTitle: "",
cancelButtonAction: {}
)

View File

@@ -162,8 +162,8 @@ struct AppStepLayerView: View {
case .serviceCenter:
ServiceCenterView()
case .createContent:
ContentCreateView()
case .createContent(let onSuccess):
ContentCreateView(onSuccess: onSuccess)
case .liveReservationComplete(let response):
LiveReservationCompleteView(reservationCompleteData: response)

View File

@@ -46,7 +46,7 @@ struct UserProfileContentView: View {
.frame(maxWidth: .infinity)
.background(Color.button)
.cornerRadius(12)
.onTapGesture { AppState.shared.setAppStep(step: .createContent) }
.onTapGesture { AppState.shared.setAppStep(step: .createContent()) }
} else {
collectionInfoView()
}

View File

@@ -408,7 +408,7 @@ struct HomeTabView: View {
.padding(.trailing, 16.7)
.padding(.bottom, 16.7)
.onTapGesture {
AppState.shared.setAppStep(step: .createContent)
AppState.shared.setAppStep(step: .createContent())
}
}

View File

@@ -70,6 +70,7 @@ struct CreatorChannelFloatingActionMenu: View {
.padding(.bottom, SodaSpacing.s32)
.animation(animation, value: isPresented)
}
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottomTrailing)
}
private func floatingButton(

View File

@@ -7,6 +7,7 @@ struct CreatorChannelView: View {
@StateObject private var viewModel = CreatorChannelViewModel()
@StateObject private var channelDonationViewModel = ChannelDonationViewModel()
@StateObject private var liveViewModel = LiveViewModel()
@StateObject private var mypageViewModel = MyPageViewModel()
@AppStorage("token") private var token: String = UserDefaults.string(forKey: UserDefaultsKey.token)
@AppStorage("auth") private var auth: Bool = UserDefaults.bool(forKey: UserDefaultsKey.auth)
@@ -15,6 +16,7 @@ struct CreatorChannelView: View {
@State private var isShowChannelDonationDialog = false
@State private var isShowAuthView = false
@State private var isShowAuthConfirmView = false
@State private var isCreatorActionMenuPresented = false
@State private var pendingAction: (() -> Void)? = nil
@State private var payload = Payload()
@@ -84,6 +86,15 @@ struct CreatorChannelView: View {
LoadingView()
}
if isOwnCreatorChannel && viewModel.selectedTab == .home && !viewModel.isLoading {
CreatorChannelFloatingActionMenu(
isPresented: $isCreatorActionMenuPresented,
onTapCommunityPost: showCommunityWrite,
onTapAudioContent: showAudioContentUpload,
onTapCreateLive: showCreateLive
)
}
if isShowAuthConfirmView {
authConfirmDialog
}
@@ -123,6 +134,11 @@ struct CreatorChannelView: View {
}
.sodaToast(isPresented: $viewModel.isShowPopup, message: viewModel.errorMessage, autohideIn: 1)
.sodaToast(isPresented: $channelDonationViewModel.isShowPopup, message: channelDonationViewModel.errorMessage, autohideIn: 2)
.onChange(of: viewModel.selectedTab) { selectedTab in
if selectedTab != .home {
isCreatorActionMenuPresented = false
}
}
}
private func titleBar(backgroundProgress: CGFloat) -> some View {
@@ -289,6 +305,37 @@ struct CreatorChannelView: View {
AppState.shared.setAppStep(step: .creatorCommunityAll(creatorId: creatorId))
}
private func showCommunityWrite() {
isCreatorActionMenuPresented = false
AppState.shared.setAppStep(
step: .creatorCommunityWrite(onSuccess: {
viewModel.fetchHome(creatorId: creatorId)
})
)
}
private func showAudioContentUpload() {
isCreatorActionMenuPresented = false
AppState.shared.setAppStep(
step: .createContent(onSuccess: {
viewModel.fetchHome(creatorId: creatorId)
})
)
}
private func showCreateLive() {
isCreatorActionMenuPresented = false
AppState.shared.setAppStep(step: .createLive(timeSettingMode: .NOW, onSuccess: handleCreateLiveSuccess))
}
private func handleCreateLiveSuccess(response: CreateLiveRoomResponse) {
liveViewModel.getLiveMain()
if let _ = response.channelName {
liveViewModel.enterRoom(roomId: response.id!)
}
viewModel.fetchHome(creatorId: creatorId)
}
private func handleScheduleTap(type: CreatorActivityType, targetId: Int) {
guard targetId > 0 else { return }