Files
github-actions[bot]andgithub-actions[bot] 7c15913e46 Version Packages (#883)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-04-20 21:57:14 -07:00

27 KiB

@thirdweb-dev/react-native

0.2.8

Patch Changes

  • #874 49922de9 Thanks @iketw! - [RN] Adds Auth to React Native

    • Adds an optional secureStorage to authConfig
    • Adds expo-secure-store to store the JWT token securely in React Native, passing a default value
    • Stores the token in secure storage to be accessed by subsequent calls
    • Returns the token in useLogin to be used by the user

    How I tested:

    • Tested in Android/iOS/Web

    Usage:

    <ThirdwebProvider
          activeChain="ethereum"
          supportedWallets={[metamaskWallet(), rainbowWallet()]}
          authConfig={{
            domain: https://your-domain.com,
            authUrl: '/api/auth',
          }}>
          <AppInner />
        </ThirdwebProvider>
    
    const { login } = useLogin();
    const { logout } = useLogout();
    const { user, isLoggedIn } = useUser();
    ...
    
    const token = await login();
    
  • #886 51e6b414 Thanks @iketw! - [ReactNative] Fixes Coinbase wallet on iOS

    • Adds connect wallet hooks for the supported wallets:
    1. useMetaMaskWallet
    2. useCoinbaseWallet
    3. useRainbowWallet
    4. useTrustWallet

    Usage:

    const connect = useMetaMaskWallet();
    connect();
    
  • #916 0b1f5229 Thanks @iketw! - [ReactNative] Improve customization of buttons background and text colors

    You can now pass custom background and text colors without having to create the full theme object. Alternatively, you can complete customize the theme:

    import { ConnectWallet, darkTheme } from '@thirdweb-dev/react-native';
    
    <ConnectWallet theme={darkTheme({
       buttonBackgroundColor: '#new-color',
       buttonTextColor: '#another-color'
    })}
    />
    
    import { Web3Button, lightTheme } from '@thirdweb-dev/react-native';
    
    <Web3Button theme={lightTheme({
       buttonBackgroundColor: '#new-color',
       buttonTextColor: '#another-color'
    })}
    />
    

    Customizing theme beyond the button:

    import { ConnectWallet, darkTheme } from '@thirdweb-dev/react-native';
    
    const darkThemeCustom = darkTheme();
    
    <ConnectWallet
        theme={{
        ...darkThemeCustom,
        colors: {
            ...darkThemeCustom.colors,
            backgroundHighlight: 'blue',
        },
        }}
    />
    
  • Updated dependencies [abe88599, 49922de9, 4acb2b55, 82bea3fa, ea04edf4, 77224646, c9ee9b32, 00f4355f, a6610f12, 06cc1df3, 29146e00, 77224646, 430a5f79, 664d1cd0, bfdd8493, c2fec930, 477324ec]:

0.2.7

Patch Changes

0.2.6

Patch Changes

0.2.5

Patch Changes

0.2.4

Patch Changes

0.2.3

Patch Changes

0.2.2

Patch Changes

0.2.1

Patch Changes

0.2.0

Minor Changes

  • #584 d01b135d Thanks @MananTank! - [Wallets, RN, React, ReactCore] New Wallets SDK implementation

    Breaking changes:

    React and React Native

    1. Replaced walletConnectors with supportedWallets in the ThirdwebProvider.
      import { coinbaseWallet, metamaskWallet, ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      - return <ThirdwebProvider walletConnectors={["metamask", "coinbaseWallet"]}>{...}</ThirdwebProvider>
      + return <ThirdwebProvider supportedWallets={[metamaskWallet(), coinbaseWallet()]}>{...}</ThirdwebProvider>
      }
    
    1. magicLinkConnector not yet implemented in this version

    2. Removed desiredChainId, use activeChain instead

    3. DAppMetaData type now requires the url field to be passed in

    4. Removed chainRpc prop from the ThirdwebProvider. You can pass custom rpcs in the Chain object through the activeChain and supportedChains props.

    5. Replaced the useNetwork hook for useChain and useSwitchChain

    6. Updated ConnectWallet button in React:

    • Removed accentColor and colorMode
    • Added a theme prop with dark and light values
    1. Updated the Web3Button button in React:
    • Removed accentColor and colorMode
    • Added a theme prop with dark and light values

    Patch Changes

    • You can now pass a theme prop to the ThirdwebProvider. Values are light and dark
      import { ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      return <ThirdwebProvider theme='light'>{...}</ThirdwebProvider>
      }
    
    • New wallet hooks added

      • useWallet()
      • useConenct()
      • useConnectionStatus()
      • useSwitchChain()
    • Removed wagmi dependency from the react-native-compat package and updated shims

    • New ConnectWallet and Web3Button components in React Native

    • New wallets package with support for the most common wallets. MetaMask, Coinbase, WalletConnect V1 and V2 and PaperWallet

    • Added autoSwitch prop to the ThirdwebProvider to control whether or not to automatically switch to wallet's network to active chain

      import { ThirdwebProvider } from "@thirdweb-dev/react";
    
      const App = () => {
      return <ThirdwebProvider autoSwitch>{...}</ThirdwebProvider>
      }
    
  • #584 d01b135d Thanks @MananTank! - [Wallets] New and updated wallets. [RN] UI Components and Wallets support.

Patch Changes

0.1.9

Patch Changes

0.1.8

Patch Changes

0.1.7

Patch Changes

0.1.6

Patch Changes

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes