-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Points: hook up points tab ui to metadata api (#5176)
* points hook * some error state + pull to refresh * fix copy haptic + pull to refresh * fix * Points: introductory flow (#5201) * refactor * claim logic * mutation * claim content * referral screen * referral ui * temp * fix android input and tabs * fix animation + back button android * layout fixes * final fixes + i18n * Points: signing up (#5210) * Add SF Mono, SF Pro Rounded Black * Add AnimatePresence * Update green/red colors * Add ConsoleSheet * Hook up iOS fonts * Hook up to PointsScreen * Style fixes * hook up some logic to claim signing * no retroactive points ui * fix points content layout * fix * i18n * fix error logging --------- Co-authored-by: Christian Baroni <[email protected]> * remove obsolete useFocusEffect * ImgixImage * simulationClient -> metadataPOSTClient --------- Co-authored-by: Christian Baroni <[email protected]> --------- Co-authored-by: Christian Baroni <[email protected]>
- Loading branch information
1 parent
51e3347
commit 8665907
Showing
33 changed files
with
3,096 additions
and
917 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 |
---|---|---|
|
@@ -41,7 +41,9 @@ | |
A4277DA323CFE85F0042BAF4 /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4277DA223CFE85F0042BAF4 /* Theme.swift */; }; | ||
A4D04BA923D12F99008C1DEC /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4D04BA823D12F99008C1DEC /* Button.swift */; }; | ||
A4D04BAC23D12FD5008C1DEC /* ButtonManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A4D04BAB23D12FD5008C1DEC /* ButtonManager.m */; }; | ||
A9F312A50F28216E0C2FC393 /* libPods-PriceWidgetExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 73790DA1833435B55F6617C8 /* libPods-PriceWidgetExtension.a */; }; | ||
AA0B1CBB2B00C5E100EAF77D /* SF-Mono-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = AA0B1CB82B00C5E100EAF77D /* SF-Mono-Semibold.otf */; }; | ||
AA0B1CBD2B00C5E100EAF77D /* SF-Mono-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = AA0B1CB92B00C5E100EAF77D /* SF-Mono-Bold.otf */; }; | ||
AA0B1CBF2B00C5E100EAF77D /* SF-Pro-Rounded-Black.otf in Resources */ = {isa = PBXBuildFile; fileRef = AA0B1CBA2B00C5E100EAF77D /* SF-Pro-Rounded-Black.otf */; }; | ||
AA6228EF24272F510078BDAA /* SF-Pro-Rounded-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = AA6228EB24272B200078BDAA /* SF-Pro-Rounded-Bold.otf */; }; | ||
AA6228F024272F510078BDAA /* SF-Pro-Rounded-Heavy.otf in Resources */ = {isa = PBXBuildFile; fileRef = AA6228EC24272B200078BDAA /* SF-Pro-Rounded-Heavy.otf */; }; | ||
AA6228F124272F510078BDAA /* SF-Pro-Rounded-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = AA6228ED24272B200078BDAA /* SF-Pro-Rounded-Medium.otf */; }; | ||
|
@@ -259,14 +261,14 @@ | |
A4277DA223CFE85F0042BAF4 /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = "<group>"; }; | ||
A4D04BA823D12F99008C1DEC /* Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = "<group>"; }; | ||
A4D04BAB23D12FD5008C1DEC /* ButtonManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ButtonManager.m; sourceTree = "<group>"; }; | ||
A56EC7992F140DBE3A0BC44D /* Pods-PriceWidgetExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PriceWidgetExtension.debug.xcconfig"; path = "Target Support Files/Pods-PriceWidgetExtension/Pods-PriceWidgetExtension.debug.xcconfig"; sourceTree = "<group>"; }; | ||
A873FCD38CDC7FEB5E93833F /* Pods-Rainbow.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Rainbow.debug.xcconfig"; path = "Target Support Files/Pods-Rainbow/Pods-Rainbow.debug.xcconfig"; sourceTree = "<group>"; }; | ||
AA0B1CB82B00C5E100EAF77D /* SF-Mono-Semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SF-Mono-Semibold.otf"; path = "../src/assets/fonts/SF-Mono-Semibold.otf"; sourceTree = "<group>"; }; | ||
AA0B1CB92B00C5E100EAF77D /* SF-Mono-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SF-Mono-Bold.otf"; path = "../src/assets/fonts/SF-Mono-Bold.otf"; sourceTree = "<group>"; }; | ||
AA0B1CBA2B00C5E100EAF77D /* SF-Pro-Rounded-Black.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SF-Pro-Rounded-Black.otf"; path = "../src/assets/fonts/SF-Pro-Rounded-Black.otf"; sourceTree = "<group>"; }; | ||
AA6228EA24272B200078BDAA /* SF-Pro-Rounded-Semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SF-Pro-Rounded-Semibold.otf"; path = "../src/assets/fonts/SF-Pro-Rounded-Semibold.otf"; sourceTree = "<group>"; }; | ||
AA6228EB24272B200078BDAA /* SF-Pro-Rounded-Bold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SF-Pro-Rounded-Bold.otf"; path = "../src/assets/fonts/SF-Pro-Rounded-Bold.otf"; sourceTree = "<group>"; }; | ||
AA6228EC24272B200078BDAA /* SF-Pro-Rounded-Heavy.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SF-Pro-Rounded-Heavy.otf"; path = "../src/assets/fonts/SF-Pro-Rounded-Heavy.otf"; sourceTree = "<group>"; }; | ||
AA6228ED24272B200078BDAA /* SF-Pro-Rounded-Medium.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SF-Pro-Rounded-Medium.otf"; path = "../src/assets/fonts/SF-Pro-Rounded-Medium.otf"; sourceTree = "<group>"; }; | ||
AA6228EE24272B200078BDAA /* SF-Pro-Rounded-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SF-Pro-Rounded-Regular.otf"; path = "../src/assets/fonts/SF-Pro-Rounded-Regular.otf"; sourceTree = "<group>"; }; | ||
AD490CBDAC6554605BF1847A /* Pods-PriceWidgetExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PriceWidgetExtension.release.xcconfig"; path = "Target Support Files/Pods-PriceWidgetExtension/Pods-PriceWidgetExtension.release.xcconfig"; sourceTree = "<group>"; }; | ||
B0C692B061D7430D8194DC98 /* ToolTipMenuTests.xctest */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = wrapper.cfbundle; path = ToolTipMenuTests.xctest; sourceTree = "<group>"; }; | ||
B50C9AE92A9D18DC00EB0019 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; }; | ||
B50C9AEA2A9D18DC00EB0019 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; }; | ||
|
@@ -699,6 +701,9 @@ | |
DCAC1D8CC45E468FBB7E1395 /* Resources */ = { | ||
isa = PBXGroup; | ||
children = ( | ||
AA0B1CB92B00C5E100EAF77D /* SF-Mono-Bold.otf */, | ||
AA0B1CB82B00C5E100EAF77D /* SF-Mono-Semibold.otf */, | ||
AA0B1CBA2B00C5E100EAF77D /* SF-Pro-Rounded-Black.otf */, | ||
AA6228EB24272B200078BDAA /* SF-Pro-Rounded-Bold.otf */, | ||
AA6228EC24272B200078BDAA /* SF-Pro-Rounded-Heavy.otf */, | ||
AA6228ED24272B200078BDAA /* SF-Pro-Rounded-Medium.otf */, | ||
|
@@ -871,6 +876,7 @@ | |
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, | ||
B5D7F2F129E8D41E003D6A54 /* [email protected] in Resources */, | ||
B54C1D1029358946007560D9 /* [email protected] in Resources */, | ||
AA0B1CBD2B00C5E100EAF77D /* SF-Mono-Bold.otf in Resources */, | ||
24979E8920F84250007EB0DA /* GoogleService-Info.plist in Resources */, | ||
B54C1D162935A54F007560D9 /* [email protected] in Resources */, | ||
B5CE8FFE29A5758100EB1EFA /* [email protected] in Resources */, | ||
|
@@ -879,9 +885,11 @@ | |
15CF49BD2889AF7C005F92C9 /* [email protected] in Resources */, | ||
1539422824C7C7E200E4A9D1 /* Settings.bundle in Resources */, | ||
15C398832880EDFF006033AC /* [email protected] in Resources */, | ||
AA0B1CBB2B00C5E100EAF77D /* SF-Mono-Semibold.otf in Resources */, | ||
B50C9AEC2A9D18DC00EB0019 /* [email protected] in Resources */, | ||
B54C1D1129358946007560D9 /* [email protected] in Resources */, | ||
B54C1D1229358946007560D9 /* [email protected] in Resources */, | ||
AA0B1CBF2B00C5E100EAF77D /* SF-Pro-Rounded-Black.otf in Resources */, | ||
15CF49C12889AFAD005F92C9 /* [email protected] in Resources */, | ||
C04D10F025AFC8C1003BEF7A /* Extras.json in Resources */, | ||
B5CC6D3A2A7873300037D5A3 /* [email protected] in Resources */, | ||
|
@@ -910,6 +918,7 @@ | |
files = ( | ||
C1AA308F27338F2B00136A9A /* SF-Pro-Rounded-Bold.otf in Resources */, | ||
C1AA309027338F2B00136A9A /* SF-Pro-Rounded-Regular.otf in Resources */, | ||
AA0B1CC02B00C5E100EAF77D /* SF-Pro-Rounded-Black.otf in Resources */, | ||
C1C61A83272CBDA100E5C0B3 /* Images.xcassets in Resources */, | ||
C1AA309227338F2B00136A9A /* SF-Pro-Rounded-Medium.otf in Resources */, | ||
C1AA309527338F2B00136A9A /* SF-Pro-Rounded-Heavy.otf in Resources */, | ||
|
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,73 @@ | ||
import React, { useEffect, useMemo, useState } from 'react'; | ||
import Animated, { | ||
Easing, | ||
EasingFunctionFactory, | ||
FadeIn, | ||
useAnimatedStyle, | ||
withTiming, | ||
} from 'react-native-reanimated'; | ||
|
||
interface AnimatePresenceProps { | ||
children: React.ReactNode; | ||
condition: boolean | null | undefined; | ||
duration?: number; | ||
easing?: EasingFunctionFactory; | ||
exitDuration?: number; | ||
exitEasing?: EasingFunctionFactory; | ||
enterAnimation?: typeof FadeIn; | ||
} | ||
|
||
const defaultTimingConfig = { | ||
duration: 225, | ||
easing: Easing.bezier(0.2, 0, 0, 1), | ||
}; | ||
|
||
const exitTimingConfig = { | ||
duration: 125, | ||
easing: Easing.bezier(0.3, 0, 1, 1), | ||
}; | ||
|
||
export const AnimatePresence = ({ | ||
children, | ||
condition, | ||
duration = defaultTimingConfig.duration, | ||
easing = defaultTimingConfig.easing, | ||
exitEasing = exitTimingConfig.easing, | ||
exitDuration = exitTimingConfig.duration, | ||
enterAnimation = FadeIn, | ||
}: AnimatePresenceProps) => { | ||
const [isMounted, setIsMounted] = useState(condition); | ||
const [isExiting, setIsExiting] = useState(false); | ||
|
||
const enterAnimationStyle = useMemo(() => { | ||
return enterAnimation.duration(duration).easing(easing.factory()); | ||
}, [enterAnimation, duration, easing]); | ||
|
||
useEffect(() => { | ||
if (condition) { | ||
setIsExiting(false); | ||
setIsMounted(true); | ||
} else { | ||
setIsExiting(true); | ||
// Wait for exit animation completion | ||
setTimeout(() => { | ||
setIsMounted(false); | ||
}, exitDuration || duration); | ||
} | ||
}, [condition, duration, exitDuration]); | ||
|
||
const animatedStyle = useAnimatedStyle(() => { | ||
return { | ||
opacity: withTiming(isExiting ? 0 : 1, { | ||
duration: exitDuration, | ||
easing: exitEasing, | ||
}), | ||
}; | ||
}, [isExiting, duration, easing]); | ||
|
||
return isMounted ? ( | ||
<Animated.View entering={enterAnimationStyle} style={animatedStyle}> | ||
{children} | ||
</Animated.View> | ||
) : null; | ||
}; |
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
Oops, something went wrong.