-
-
Save Ashoat/b817a9b8fec02537f3f2145594c9721c to your computer and use it in GitHub Desktop.
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
diff --git a/native/components/color-splotch.react.js b/native/components/color-splotch.react.js | |
index 3626c4ce0..3a85ceb47 100644 | |
--- a/native/components/color-splotch.react.js | |
+++ b/native/components/color-splotch.react.js | |
@@ -3,6 +3,9 @@ | |
import * as React from 'react'; | |
import { StyleSheet } from 'react-native'; | |
import { SquircleView } from 'react-native-figma-squircle'; | |
+import { Image } from 'expo-image'; | |
+ | |
+import { ENSCacheContext } from 'lib/components/ens-cache-provider.react.js'; | |
type Props = { | |
+color: string, | |
@@ -20,14 +23,42 @@ function ColorSplotch(props: Props): React.Node { | |
return styles.large; | |
}, [size]); | |
+ const [uri, setURI] = React.useState(); | |
+ const cacheContext = React.useContext(ENSCacheContext); | |
+ const { ensCache } = cacheContext; | |
+ React.useEffect(() => { | |
+ if (!ensCache) { | |
+ return; | |
+ } | |
+ (async () => { | |
+ console.log('ensAvatarURI fetch starting'); | |
+ const ensAvatarURI = await ensCache.getAvatarURIForAddress( | |
+ '0x07124c3b6687e78aec8f13a2312cba72a0bed387', | |
+ ); | |
+ console.log('ensAvatarURI fetch complete'); | |
+ setURI(ensAvatarURI); | |
+ })(); | |
+ }, [ensCache]); | |
+ const source = React.useMemo(() => ({ uri }), [uri]); | |
+ console.log(uri); | |
+ | |
+ if (size !== 'profile') { | |
+ return ( | |
+ <SquircleView | |
+ style={style} | |
+ squircleParams={{ | |
+ cornerSmoothing: 0.95, | |
+ cornerRadius: 10, | |
+ fillColor: `#${color}`, | |
+ }} | |
+ /> | |
+ ); | |
+ } | |
+ | |
return ( | |
- <SquircleView | |
+ <Image | |
+ source={source} | |
style={style} | |
- squircleParams={{ | |
- cornerSmoothing: 0.95, | |
- cornerRadius: 10, | |
- fillColor: `#${color}`, | |
- }} | |
/> | |
); | |
} | |
diff --git a/native/utils/ethers-utils.js b/native/utils/ethers-utils.js | |
index 93bac9cd4..3e14d172e 100644 | |
--- a/native/utils/ethers-utils.js | |
+++ b/native/utils/ethers-utils.js | |
@@ -15,7 +15,7 @@ try { | |
let provider: ?EthersProvider; | |
if (alchemyKey) { | |
- provider = new ethers.providers.AlchemyProvider('mainnet', alchemyKey); | |
+ provider = new ethers.providers.AlchemyProvider('goerli', alchemyKey); | |
} | |
export { provider }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment