-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
177 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// Copyright RevenueCat Inc. All Rights Reserved. | ||
// | ||
// Licensed under the MIT License (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://opensource.org/licenses/MIT | ||
// | ||
// FeedbackSurveyData.swift | ||
// | ||
// | ||
// Created by Cesar de la Vega on 14/6/24. | ||
// | ||
|
||
import Foundation | ||
import RevenueCat | ||
|
||
#if !os(macOS) && !os(tvOS) && !os(watchOS) && !os(visionOS) | ||
|
||
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) | ||
@available(macOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
class FeedbackSurveyData: ObservableObject { | ||
|
||
var configuration: CustomerCenterConfigData.HelpPath.FeedbackSurvey | ||
var action: (() -> Void) | ||
|
||
init(configuration: CustomerCenterConfigData.HelpPath.FeedbackSurvey, action: @escaping (() -> Void)) { | ||
self.configuration = configuration | ||
self.action = action | ||
} | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
RevenueCatUI/CustomerCenter/Views/FeedbackSurveyView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// | ||
// Copyright RevenueCat Inc. All Rights Reserved. | ||
// | ||
// Licensed under the MIT License (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://opensource.org/licenses/MIT | ||
// | ||
// FeedbackSurveyView.swift | ||
// | ||
// | ||
// Created by Cesar de la Vega on 12/6/24. | ||
// | ||
|
||
import RevenueCat | ||
import SwiftUI | ||
|
||
#if !os(macOS) && !os(tvOS) && !os(watchOS) && !os(visionOS) | ||
|
||
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) | ||
@available(macOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
@available(visionOS, unavailable) | ||
struct FeedbackSurveyView: View { | ||
|
||
@ObservedObject | ||
var feedbackSurveyData: FeedbackSurveyData | ||
|
||
var body: some View { | ||
VStack { | ||
Text("Why are you cancelling?") | ||
.font(.title) | ||
.padding() | ||
|
||
Spacer() | ||
|
||
FeedbackSurveyButtonsView(options: feedbackSurveyData.configuration.options, | ||
action: feedbackSurveyData.action) | ||
} | ||
} | ||
|
||
} | ||
|
||
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *) | ||
@available(macOS, unavailable) | ||
@available(tvOS, unavailable) | ||
@available(watchOS, unavailable) | ||
@available(visionOS, unavailable) | ||
struct FeedbackSurveyButtonsView: View { | ||
|
||
let options: [CustomerCenterConfigData.HelpPath.FeedbackSurvey.Option] | ||
let action: (() -> Void) | ||
|
||
var body: some View { | ||
VStack(spacing: 16) { | ||
ForEach(options, id: \.id) { option in | ||
Button(option.title) { | ||
Task { | ||
self.action() | ||
} | ||
} | ||
.buttonStyle(ManageSubscriptionsButtonStyle()) | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters