Skip to content

Instantly share code, notes, and snippets.

@dlazares
Created August 24, 2022 05:50
Show Gist options
  • Save dlazares/da6adb54db89052967b6559d485fa373 to your computer and use it in GitHub Desktop.
Save dlazares/da6adb54db89052967b6559d485fa373 to your computer and use it in GitHub Desktop.
Walletconnect React Native Modal that also works on iOS simulator
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