@@ -47,10 +47,13 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable {
47
47
private var forExampleDisplay : Bool = false {
48
48
didSet {
49
49
isUserInteractionEnabled = false
50
+ cardFrameView. isUserInteractionEnabled = false
50
51
isAnswered = false
51
52
}
52
53
}
53
54
55
+ private var blog : Blog ?
56
+
54
57
// Used to present the menu sheet for contextual menu.
55
58
// NOTE: Remove this once we drop support for iOS 13.
56
59
private weak var presenterViewController : BlogDashboardViewController ? = nil
@@ -171,8 +174,7 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable {
171
174
button. titleLabel? . font = WPStyleGuide . BloggingPrompts. buttonTitleFont
172
175
button. titleLabel? . adjustsFontForContentSizeCategory = true
173
176
button. titleLabel? . adjustsFontSizeToFitWidth = true
174
-
175
- // TODO: Implement button tap action
177
+ button. addTarget ( self , action: #selector( answerButtonTapped) , for: . touchUpInside)
176
178
177
179
return button
178
180
} ( )
@@ -280,6 +282,7 @@ class DashboardPromptsCardCell: UICollectionViewCell, Reusable {
280
282
281
283
extension DashboardPromptsCardCell : BlogDashboardCardConfigurable {
282
284
func configure( blog: Blog , viewController: BlogDashboardViewController ? , apiResponse: BlogDashboardRemoteEntity ? ) {
285
+ self . blog = blog
283
286
self . presenterViewController = viewController
284
287
refreshStackView ( )
285
288
}
@@ -311,6 +314,19 @@ private extension DashboardPromptsCardCell {
311
314
containerStackView. addArrangedSubview ( ( isAnswered ? answeredStateView : answerButton) )
312
315
}
313
316
317
+ // MARK: Button actions
318
+
319
+ @objc func answerButtonTapped( ) {
320
+ guard let blog = blog else {
321
+ return
322
+ }
323
+
324
+ let editor = EditPostViewController ( blog: blog, prompt: . examplePrompt)
325
+ editor. modalPresentationStyle = . fullScreen
326
+ editor. entryPoint = . dashboard
327
+ presenterViewController? . present ( editor, animated: true )
328
+ }
329
+
314
330
// MARK: Context menu actions
315
331
316
332
func viewMoreMenuTapped( ) {
0 commit comments