Skip to content

Commit

Permalink
Remove extra log, lint example app, fix podfile lock
Browse files Browse the repository at this point in the history
  • Loading branch information
foyarash committed Oct 20, 2023
1 parent eb91c57 commit 23f3e37
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class RNWalletView(context: Context, appContext: AppContext) : ExpoView(context,

private val imageButtonView = ImageButton(context).also {
val buttonTypeResource = buttonTypeToResource(buttonType)
Log.v("RNWallet", "Button width is " + buttonTypeResource.width)
it.layoutParams = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
it.isClickable = true;
it.setImageResource(buttonTypeResource.resourceId)
Expand Down
48 changes: 24 additions & 24 deletions example/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from 'react';
import { useState } from "react";
import {
Alert,
Button,
Expand All @@ -7,49 +7,49 @@ import {
Text,
TextInput,
View,
} from 'react-native';
import * as RNWallet from 'react-native-wallet';
} from "react-native";
import * as RNWallet from "react-native-wallet";

export default function App() {
const [inputValue, setInputValue] = useState('');
const [inputValue, setInputValue] = useState("");

const onAdd = async () => {
try {
const isAdded = await RNWallet.addPass(inputValue);

Alert.alert('Pass added', isAdded ? 'Yes' : 'No');
Alert.alert("Pass added", isAdded ? "Yes" : "No");
} catch (error) {
Alert.alert('Error', (error as Error).message);
Alert.alert("Error", (error as Error).message);
}
};

const onCheckPassExists = async () => {
try {
const passExists = await RNWallet.hasPass(inputValue);

Alert.alert('Pass exists', passExists ? 'Yes' : 'No');
Alert.alert("Pass exists", passExists ? "Yes" : "No");
} catch (error) {
Alert.alert('Error', (error as Error).message);
Alert.alert("Error", (error as Error).message);
}
};

const onRemovePass = async () => {
try {
await RNWallet.removePass(inputValue);

Alert.alert('Pass removed');
Alert.alert("Pass removed");
} catch (error) {
Alert.alert('Error', (error as Error).message);
Alert.alert("Error", (error as Error).message);
}
};

const onCanAddPasses = async () => {
try {
const canAddPasses = await RNWallet.canAddPasses();

Alert.alert('Can add passes', canAddPasses ? 'Yes' : 'No');
Alert.alert("Can add passes", canAddPasses ? "Yes" : "No");
} catch (error) {
Alert.alert('Error', (error as Error).message);
Alert.alert("Error", (error as Error).message);
}
};

Expand All @@ -58,16 +58,16 @@ export default function App() {
<View style={styles.inputContainer}>
<Text>
{Platform.select({
ios: 'Pkpass URL',
android: 'Pass token',
ios: "Pkpass URL",
android: "Pass token",
})}
</Text>
<TextInput
value={inputValue}
onChangeText={setInputValue}
placeholder={Platform.select({
ios: 'Pkpass URL',
android: 'Pass token',
ios: "Pkpass URL",
android: "Pass token",
})}
style={styles.input}
autoCapitalize="none"
Expand All @@ -79,16 +79,16 @@ export default function App() {
<Button title="Remove pass" onPress={onRemovePass} />
<View style={styles.buttonsContainer}>
<Text style={styles.title}>
Wallet button {Platform.select({ ios: 'black', android: 'primary' })}
Wallet button {Platform.select({ ios: "black", android: "primary" })}
</Text>
<RNWallet.RNWalletView
buttonStyle={RNWallet.ButtonStyle.BLACK}
buttonType={RNWallet.ButtonType.PRIMARY}
onPress={onAdd}
/>
<Text style={styles.title}>
Wallet button{' '}
{Platform.select({ ios: 'black outline', android: 'condensed' })}
Wallet button{" "}
{Platform.select({ ios: "black outline", android: "condensed" })}
</Text>
<RNWallet.RNWalletView
buttonStyle={RNWallet.ButtonStyle.BLACK_OUTLINE}
Expand All @@ -103,29 +103,29 @@ export default function App() {
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
justifyContent: "center",
paddingHorizontal: 20,
gap: 16,
},
buttonsContainer: {
borderWidth: 1,
borderColor: 'black',
borderColor: "black",
borderRadius: 12,
padding: 10,
gap: 8,
alignItems: 'center',
alignItems: "center",
},
title: {
fontSize: 18,
fontWeight: '500',
fontWeight: "500",
},

inputContainer: {
gap: 6,
},
input: {
borderWidth: 1,
borderColor: 'black',
borderColor: "black",
borderRadius: 4,
paddingHorizontal: 10,
paddingVertical: 6,
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ PODS:
- React-jsi (= 0.72.5)
- React-logger (= 0.72.5)
- React-perflogger (= 0.72.5)
- RNWallet (0.1.0):
- RNWallet (1.0.1):
- ExpoModulesCore
- SocketRocket (0.6.1)
- Yoga (1.14.0)
Expand Down Expand Up @@ -650,7 +650,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: cc32add98c45c5df18436a6a52a7e1f6edec102c
React-utils: 7a9918a1ffdd39aba67835d42386f592ea3f8e76
ReactCommon: 91ece8350ebb3dd2be9cef662abd78b6948233c0
RNWallet: ee3286276698be49eed9c61f32dc5135a28a113e
RNWallet: c2e8ee06a606043a9e77d8ace57f8e5b42dcac5f
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 86fed2e4d425ee4c6eab3813ba1791101ee153c6

Expand Down

0 comments on commit 23f3e37

Please sign in to comment.