diff --git a/Projects/Feature/CatFeature/Sources/NamingCat/NamingCatCore.swift b/Projects/Feature/CatFeature/Sources/NamingCat/NamingCatCore.swift index 8a2e06e..2bd5ed6 100644 --- a/Projects/Feature/CatFeature/Sources/NamingCat/NamingCatCore.swift +++ b/Projects/Feature/CatFeature/Sources/NamingCat/NamingCatCore.swift @@ -26,8 +26,8 @@ public struct NamingCatCore { var isButtonDisabled: Bool = false var inputFieldError: NamingCatError? var tooltip: DownDirectionTooltip? = .init() - var catRiv: RiveViewModel = Rive.catSelectRiv(stateMachineName: "State Machine_selectCat") - + var catRiv: RiveViewModel = Rive.catRenameRiv(stateMachineName: "State Machine_Rename") + public init(route: Route) { self.route = route } @@ -36,7 +36,7 @@ public struct NamingCatCore { public enum Action: BindableAction { case onAppear case namedButtonTapped - case triggerCatAnimation + case catSetInput case moveToHome case setTooltip(DownDirectionTooltip?) case saveChangedCat(SomeCat) @@ -73,7 +73,7 @@ public struct NamingCatCore { if let myCat = try await self.userService.getUserInfo(databaseClient: self.databaseClient)?.cat { await send(.set(\.selectedCat, SomeCat(baseInfo: myCat))) } - await send(.triggerCatAnimation) + await send(.catSetInput) } case .namedButtonTapped: @@ -89,10 +89,10 @@ public struct NamingCatCore { await send(._setNextAction) } - case .triggerCatAnimation: + case .catSetInput: guard let selectedCat = state.selectedCat else { return .none } - state.catRiv.stop() - state.catRiv.triggerInput(selectedCat.rivTriggerName) + state.catRiv.reset() + state.catRiv.setInput(selectedCat.rivInputName, value: true) return .none case .moveToHome: diff --git a/Projects/Feature/CatFeature/Sources/NamingCat/NamingCatView.swift b/Projects/Feature/CatFeature/Sources/NamingCat/NamingCatView.swift index 7b253ac..7d014f2 100644 --- a/Projects/Feature/CatFeature/Sources/NamingCat/NamingCatView.swift +++ b/Projects/Feature/CatFeature/Sources/NamingCat/NamingCatView.swift @@ -30,7 +30,7 @@ public struct NamingCatView: View { store.catRiv.view() .setTooltipTarget(tooltip: DownDirectionTooltip.self) - .frame(height: 240) + .frame(minHeight: 200, maxHeight: 240) VStack(spacing: Alias.Spacing.small) { HStack { diff --git a/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatView.swift b/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatView.swift index 77ab42d..67e05bf 100644 --- a/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatView.swift +++ b/Projects/Feature/CatFeature/Sources/SelectCat/SelectCatView.swift @@ -46,7 +46,7 @@ public struct SelectCatView: View { VStack(spacing: Alias.Spacing.small) { CatPushNotificationExampleView(selectedCat: $store.selectedCat) store.catRiv.view() - .frame(height: 240) + .frame(minHeight: 200, maxHeight: 240) } Spacer(minLength: Alias.Spacing.large) @@ -103,23 +103,26 @@ struct CatPushNotificationExampleView: View { .cornerRadius(8.5, corners: .allCorners) VStack(alignment: .leading, spacing: .zero) { - Text("모하냥") - .font(Typography.bodySB) - .foregroundStyle(Alias.Color.Text.primary) + HStack { + Text("모하냥") + .font(Typography.bodySB) + .foregroundStyle(Alias.Color.Text.primary) + + Spacer() + + VStack(alignment: .trailing, spacing: .zero) { + Text("지금") + .font(Typography.captionR) + .foregroundStyle(Alias.Color.Text.primary) + Spacer() + } + .padding(.trailing, Alias.Spacing.small) + } + Text(selectedCat.disturbPushTitle) .font(Typography.subBodyR) .foregroundStyle(Alias.Color.Text.primary) } - - Spacer() - - VStack(alignment: .trailing, spacing: .zero) { - Text("지금") - .font(Typography.captionR) - .foregroundStyle(Alias.Color.Text.primary) - Spacer() - } - .padding(.trailing, Alias.Spacing.small) } .padding(.all, Alias.Spacing.large) } else { diff --git a/Projects/Shared/DesignSystem/Resources/Rive/cat_rename.riv b/Projects/Shared/DesignSystem/Resources/Rive/cat_rename.riv new file mode 100644 index 0000000..8274492 Binary files /dev/null and b/Projects/Shared/DesignSystem/Resources/Rive/cat_rename.riv differ