-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
658 additions
and
465 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// PaywallViewMode+Extensions.swift | ||
// | ||
// | ||
// Created by Nacho Soto on 8/9/23. | ||
// | ||
|
||
import RevenueCat | ||
|
||
extension PaywallViewMode { | ||
|
||
var displayAllPlansByDefault: Bool { | ||
switch self { | ||
case .fullScreen: return true | ||
case .card: return true | ||
case .condensedCard: return false | ||
} | ||
} | ||
|
||
var displayAllPlansButton: Bool { | ||
switch self { | ||
case .fullScreen: return false | ||
case .card: return false | ||
case .condensedCard: return true | ||
} | ||
} | ||
|
||
var shouldDisplayIcon: Bool { | ||
switch self { | ||
case .fullScreen: return true | ||
case .card, .condensedCard: return false | ||
} | ||
} | ||
|
||
var shouldDisplayText: Bool { | ||
switch self { | ||
case .fullScreen: return true | ||
case .card, .condensedCard: return false | ||
} | ||
} | ||
|
||
var shouldDisplayFeatures: Bool { | ||
switch self { | ||
case .fullScreen: return true | ||
case .card, .condensedCard: return false | ||
} | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// CardHidingModifier.swift | ||
// | ||
// | ||
// Created by Nacho Soto on 8/9/23. | ||
// | ||
|
||
import RevenueCat | ||
import SwiftUI | ||
|
||
@available(iOS 15.0, macOS 12.0, tvOS 15.0, *) | ||
extension View { | ||
|
||
func hideCardContent(_ hide: Bool, _ offset: CGFloat) -> some View { | ||
return self.modifier(CardHidingModifier(hide: hide, offset: offset)) | ||
} | ||
|
||
} | ||
|
||
@available(iOS 15.0, macOS 12.0, tvOS 15.0, *) | ||
private struct CardHidingModifier: ViewModifier { | ||
|
||
var hide: Bool | ||
var offset: CGFloat | ||
|
||
func body(content: Content) -> some View { | ||
content | ||
.opacity(self.hide ? 0 : 1) | ||
.offset(y: self.hide ? self.offset : 0) | ||
.frame(height: self.hide ? 0 : nil) | ||
.blur(radius: self.hide ? Self.blurRadius : 0) | ||
} | ||
|
||
private static let blurRadius: CGFloat = 20 | ||
|
||
} |
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
Oops, something went wrong.