0.2.0 • Published 11 months ago

react-native-vested-mobile-sdk v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

react-native-vested-mobile-sdk

Mobile SDK for B2B Partners

Installation

Using NPM
npm install react-native-vested-mobile-sdk
Using Yarn
yarn add react-native-vested-mobile-sdk

Usage

import { useState } from 'react';
import { SafeAreaView, StatusBar, StyleSheet } from 'react-native';
import { VestedView } from 'react-native-vested-mobile-sdk';
import { VestedBtoBButton } from './components/VestedB2BButton';

const viewStyles = {
  statusBarColor: '#121212',
  loaderColor: '#6A35FF',
};

const PARTNER_BASE_URL = 'https://next-tmp.vestedfinance.com';

export default function App() {
  const [showWebView, setShowWebView] = useState(false);
  const closeWebView = () => {
    setShowWebView(false);
  };

  return (
    <SafeAreaView style={styles.container}>
      <StatusBar animated={true} backgroundColor="#121212" barStyle="default" />
      {!showWebView ? (
        <VestedBtoBButton onButtonPress={(state) => setShowWebView(state)} />
      ) : (
        <VestedView
          url={PARTNER_BASE_URL}
          viewStyles={viewStyles}
          onClose={closeWebView}
        />
      )}
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});
0.2.0

11 months ago