@agent-cards/wallet-react-native 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.tsx +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-cards/wallet-react-native",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Drop the Agentcard wallet into a React Native app: add cards, show the wallet, approve agent payments.",
5
5
  "main": "src/index.tsx",
6
6
  "types": "src/index.tsx",
package/src/index.tsx CHANGED
@@ -38,6 +38,8 @@ export type AgentcardWalletProps = {
38
38
  onEvent?: (name: string, data: Record<string, unknown>) => void;
39
39
  /** Override how bank-approval URLs open. Default: Linking.openURL. */
40
40
  onOpenUrl?: (url: string) => void;
41
+ /** The wallet is dark by default; "light" matches a light host app. */
42
+ theme?: "dark" | "light";
41
43
  style?: StyleProp<ViewStyle>;
42
44
  };
43
45
 
@@ -61,6 +63,7 @@ export function AgentcardWallet({
61
63
  onTokenExpired,
62
64
  onEvent,
63
65
  onOpenUrl,
66
+ theme,
64
67
  style,
65
68
  }: AgentcardWalletProps) {
66
69
  const uri = useMemo(() => {
@@ -72,8 +75,9 @@ export function AgentcardWallet({
72
75
  if (pay.merchant) params.set("merchant", pay.merchant);
73
76
  params.set("amount", String(pay.amountCents));
74
77
  }
78
+ if (theme === "light") params.set("theme", "light");
75
79
  return `${baseUrl.replace(/\/+$/, "")}/embed/wallet?${params.toString()}`;
76
- }, [link, pay, baseUrl]);
80
+ }, [link, pay, baseUrl, theme]);
77
81
 
78
82
  // Late messages from a dying WebView (e.g. right after the host swapped the
79
83
  // link) must not fire stale callbacks against the new state.