mirror of
https://github.com/pepaskopec-blip/Graduately.git
synced 2026-10-27 15:14:35 +00:00
Fix the Apple build by avoiding a Content name clash in the appear animation.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
59d40c886a
commit
ef591252ba
1 changed files with 7 additions and 4 deletions
|
|
@ -17,12 +17,15 @@ struct PressScaleStyle: ButtonStyle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private struct SoftAppear: ViewModifier {
|
/// Named so it does not collide with the app's `Content` type, which would
|
||||||
|
/// otherwise hide `ViewModifier.Content` and fail the build.
|
||||||
|
private struct SoftAppear<Inner: View>: View {
|
||||||
@Environment(\.accessibilityReduceMotion) private var reduceMotion
|
@Environment(\.accessibilityReduceMotion) private var reduceMotion
|
||||||
@State private var shown = false
|
@State private var shown = false
|
||||||
|
var inner: Inner
|
||||||
|
|
||||||
func body(content: Content) -> some View {
|
var body: some View {
|
||||||
content
|
inner
|
||||||
.opacity(reduceMotion || shown ? 1 : 0)
|
.opacity(reduceMotion || shown ? 1 : 0)
|
||||||
.offset(y: reduceMotion || shown ? 0 : 8)
|
.offset(y: reduceMotion || shown ? 0 : 8)
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
|
@ -38,7 +41,7 @@ private struct SoftAppear: ViewModifier {
|
||||||
extension View {
|
extension View {
|
||||||
/// One short fade-in. Use on a landing surface, not on every pushed screen.
|
/// One short fade-in. Use on a landing surface, not on every pushed screen.
|
||||||
func softAppear() -> some View {
|
func softAppear() -> some View {
|
||||||
modifier(SoftAppear())
|
SoftAppear(inner: self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue