-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement interview preparation completed modal
- Loading branch information
1 parent
9d35ee0
commit 36afcbd
Showing
11 changed files
with
174 additions
and
15 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
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
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
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
45 changes: 45 additions & 0 deletions
45
...p/Views/Modals/InterviewPreparationCompleted/InterviewPreparationCompletedModalView.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,45 @@ | ||
import SwiftUI | ||
|
||
extension InterviewPreparationCompletedModalView { | ||
struct Appearance { | ||
let spacing: CGFloat = LayoutInsets.defaultInset * 2 | ||
let interitemSpacing = LayoutInsets.defaultInset | ||
} | ||
} | ||
|
||
struct InterviewPreparationCompletedModalView: View { | ||
private(set) var appearance = Appearance() | ||
|
||
var onCallToActionTap: () -> Void = {} | ||
|
||
var body: some View { | ||
VStack(alignment: .leading, spacing: appearance.spacing) { | ||
Image(.stageImplementStageCompletedModalIcon) | ||
.renderingMode(.original) | ||
.aspectRatio(contentMode: .fit) | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
|
||
VStack(alignment: .leading, spacing: appearance.interitemSpacing) { | ||
Text(Strings.InterviewPreparationCompletedModal.title) | ||
.font(.title2).bold() | ||
.foregroundColor(.primaryText) | ||
|
||
Text(Strings.InterviewPreparationCompletedModal.description) | ||
.font(.body) | ||
.foregroundColor(.primaryText) | ||
} | ||
|
||
Button( | ||
Strings.Common.goToTraining, | ||
action: onCallToActionTap | ||
) | ||
.buttonStyle(.primary) | ||
.shineEffect() | ||
} | ||
.padding([.horizontal, .bottom]) | ||
} | ||
} | ||
|
||
#Preview { | ||
InterviewPreparationCompletedModalView() | ||
} |
49 changes: 49 additions & 0 deletions
49
...dals/InterviewPreparationCompleted/InterviewPreparationCompletedModalViewController.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,49 @@ | ||
import SwiftUI | ||
|
||
protocol InterviewPreparationCompletedModalViewControllerDelegate: AnyObject { | ||
func interviewPreparationCompletedModalViewControllerDidAppear( | ||
_ viewController: InterviewPreparationCompletedModalViewController | ||
) | ||
func interviewPreparationCompletedModalViewControllerDidDisappear( | ||
_ viewController: InterviewPreparationCompletedModalViewController | ||
) | ||
func interviewPreparationCompletedModalViewControllerDidTapCallToActionButton( | ||
_ viewController: InterviewPreparationCompletedModalViewController | ||
) | ||
} | ||
|
||
final class InterviewPreparationCompletedModalViewController: PanModalSwiftUIViewController< | ||
InterviewPreparationCompletedModalView | ||
> { | ||
private weak var delegate: InterviewPreparationCompletedModalViewControllerDelegate? | ||
|
||
convenience init(delegate: InterviewPreparationCompletedModalViewControllerDelegate?) { | ||
var view = InterviewPreparationCompletedModalView() | ||
|
||
self.init( | ||
isPresented: .init(get: { false }, set: { _ in }), | ||
content: { view } | ||
) | ||
|
||
view.onCallToActionTap = { [weak self] in | ||
guard let strongSelf = self else { | ||
return | ||
} | ||
|
||
strongSelf.delegate?.interviewPreparationCompletedModalViewControllerDidTapCallToActionButton(strongSelf) | ||
strongSelf.dismiss(animated: true) | ||
} | ||
|
||
self.delegate = delegate | ||
} | ||
|
||
override func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
delegate?.interviewPreparationCompletedModalViewControllerDidAppear(self) | ||
} | ||
|
||
override func viewDidDisappear(_ animated: Bool) { | ||
super.viewDidDisappear(animated) | ||
delegate?.interviewPreparationCompletedModalViewControllerDidDisappear(self) | ||
} | ||
} |
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
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