Skip to content
This repository has been archived by the owner on May 8, 2021. It is now read-only.

kolyan94/RNAntViewer

Repository files navigation

react-native-ant-viewer

Getting started

  1. $ npm install react-native-ant-viewer

Manual installation

iOS

If you use Cocoapods:

  1. Add pod 'RNAntViewer', path: '../node_modules/react-native-ant-viewer' to your Podfile
  2. $ pod install

If not:

  1. $ pod init
platform :ios, '11.3'
use_frameworks!
target 'your_app_name' do
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge', # Include this for RN >= 0.47
'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
'RCTText',
'RCTNetwork',
'RCTWebSocket', # needed for debugging
# Add any other subspecs you want to use in your project
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'RNAntViewer', path: '../node_modules/react-native-ant-viewer'

end
  1. $ pod install

Troubleshooting

https://stackoverflow.com/questions/50096025/it-gives-errors-when-using-swift-static-library-with-objective-c-project

Usage

import AntWidget from 'react-native-ant-viewer';

export default class App extends Component<Props> {
  render() {
    return (
      <View style={styles.container}>
        <AntWidget
        isLightMode={true}
        bottomMargin={40}
        rightMargin={30}
        onViewerAppear={() => console.log("Appeared")}
        onViewerDisappear={() => console.log("Disappeared")}
        />
        <Text style={styles.welcome}>Welcome to React Native!</Text>
        <Text style={styles.instructions}>To get started, edit App.js</Text>
        <Text style={styles.instructions}>{instructions}</Text>
      </View>
    );
  }
}
Property Type Description
isLightMode Bool There are two widget appearance modes: light & dark. By default false.
bottomMargin Number Bottom margin. Default: 20.
rightMargin Number Right margin. Default: 20.
onViewerAppear Callback Called when the user opens the widget controller.
onViewerDisappear Callback Called when the user dismisses the widget controller.

Author

Mykola Vaniurskyi, [email protected]

License

RNAntViewer is available under the MIT license. See the LICENSE file for more info.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published