Created
August 24, 2022 05:50
-
-
Save dlazares/da6adb54db89052967b6559d485fa373 to your computer and use it in GitHub Desktop.
Walletconnect React Native Modal that also works on iOS simulator
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
import { | |
Qrcode, | |
RenderQrcodeModalProps, | |
WalletService, | |
WalletServiceRow, | |
} from '@walletconnect/react-native-dapp'; | |
<View > | |
<Text>Show QR code:</Text> | |
<Switch | |
value={shouldRenderQrcode} | |
onValueChange={setShouldRenderQrcode} | |
/> | |
</View> | |
{shouldRenderQrcode ? ( | |
<Animated.View style={{ width: qrCodeSize, height: qrCodeSize }}> | |
<Animated.View | |
style={[ | |
StyleSheet.absoluteFill, | |
QrCodeModalStyles.center, | |
{ opacity: icons, transform: [{ scale: icons }] }, | |
]}> | |
<Qrcode uri={uri} size={qrCodeSize * 0.8} /> | |
</Animated.View> | |
</Animated.View> | |
) : ( | |
{/*normal way of rendering your modal here*/} | |
)} | |
<View /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment