Giter Club home page Giter Club logo

react-native-circle-drawer's Introduction

NPM

Description

This is a Drawer for React-Native inspired by Karan Shah Navigation Index Concept

Karan Shah Dribbble account

Karan Shah Navigation Index Concept

drawer gif

Installation

npm install --save react-native-circle-drawer

or

yarn add react-native-circle-drawer

Use

import Drawer from 'react-native-circle-drawer'

render(){
    return(
        <Drawer sideMenu={this.renderSideMenu()}>
            <App/>
        </Index>
    )
}

Props

name type default description
primaryColor string #731ED2
secondaryColor string #9646EC
cancelColor string #731ED2
sideMenu React.Component
topRightView React.Component
marginLeft number 0 left margin starting from the middle of the circle
marginTop number 0 top margin starting from the middle of the circle
openStart function callback when the open animation begin
openEnd function callback when the open animation end
closeStart function callback when the close animation begin
closeEnd function callback when the close animation end

Functions

name description
open open the drawer
close close the drawer

Example

    openDrawer(){
        this.refs.DRAWER.open;
    }
    
    renderSideMenu(){
        return(
            <View style={{flex:1}}>
                <Text>Item 1 </Text>
                <Text>Item 2 </Text>
            </View>
        )
    }
    
    renderTopRightView(){
        return(
            <View>
                <Text>Hello</Text>
            </View>
        )
    }
    
    render(){
        <Drawer
            ref="DRAWER"
            sideMenu={this.renderSideMenu()}
            topRightView={this.renderTopRightView()}
        >
          <Button title="open drawer" onPress={()=>this.openDrawer()} />
          <Text>Main application here!!</Text>
        </Drawer>
    
    }
    

Licence

MIT

Credit

Karan Shah

react-native-circle-drawer's People

Contributors

dopey2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-circle-drawer's Issues

react-native-circle-drawer is not working

Here is the source code ๐Ÿ‘
/**

import React, { Component } from "react";
import { Platform, StyleSheet, View, Image, TouchableOpacity, Alert, Text, Button } from "react-native";
import Drawer from 'react-native-circle-drawer'

export default class App extends Component {

constructor(props) {
  super(props);
}

openDrawer(){
    this.refs.DRAWER.open
}

renderSideMenu(){
    return(
        <View style={{flex:1}}>
            <Text>Item 1 </Text>
            <Text>Item 2 </Text>
        </View>
    )
}

renderTopRightView(){
    return(
        <View>
            <Text>Hello</Text>
        </View>
    )
}

render() {
  return (
    <Drawer
        ref="DRAWER"
        sideMenu={this.renderSideMenu()}
        topRightView={this.renderTopRightView()}
    >
      <Button title="open drawer" onPress={()=>this.openDrawer()} />
      <Text>Main application here!!</Text>
    </Drawer>
  );
}

}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
backgroundColor: '#ecf0f1',
padding: 8,
},
});

Showing below error message ๐Ÿ‘ ---------------------------------------------------------------------
TypeError: One of the sources for assign has an enumerable key on the prototype chain. Are you trying to assign a prototype property? We don't allow it, as this is an edge case that we do not support. This error is a performance optimization and not spec compliant.

This error is located at:
in Drawer (at App.js:41)
in App (at renderApplication.js:33)
in RCTView (at View.js:60)
in View (at AppContainer.js:102)
in RCTView (at View.js:60)
in View (at AppContainer.js:122)
in AppContainer (at renderApplication.js:32)
assign
D:\MobileApp56\node_modules\react-native\Libraries\polyfills\Object.es6.js:54:12
renderDrawer
D:\MobileApp56\node_modules\react-native-circle-drawer\Drawer.js:84:16
proxiedMethod
D:\MobileApp56\node_modules\react-proxy\modules\createPrototypeProxy.js:44:35
render
D:\MobileApp56\node_modules\react-native-circle-drawer\Drawer.js:148:9
proxiedMethod
D:\MobileApp56\node_modules\react-proxy\modules\createPrototypeProxy.js:44:35
finishClassComponent
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:8811:23
updateClassComponent
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:8762:6
beginWork
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:9581:10
performUnitOfWork
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:12924:25
workLoop
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:12953:43
renderRoot
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:12996:17
performWorkOnRoot
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13632:34
performWork
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13545:26
performSyncWork
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13506:16
requestWork
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13392:6
scheduleWorkImpl
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13259:24
scheduleWork
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13207:28
scheduleRootUpdate
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13930:17
_updateContainerAtExpirationTime
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13966:6
updateContainer
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:13991:8
render
D:\MobileApp56\node_modules\react-native\Libraries\Renderer\ReactNativeRenderer-dev.js:14726:35
renderApplication
D:\MobileApp56\node_modules\react-native\Libraries\ReactNative\renderApplication.js:49:21
run
D:\MobileApp56\node_modules\react-native\Libraries\ReactNative\AppRegistry.js:102:10
runApplication
D:\MobileApp56\node_modules\react-native\Libraries\ReactNative\AppRegistry.js:194:26
__callFunction
D:\MobileApp56\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:351:47

D:\MobileApp56\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:116:26
__guardSafe
D:\MobileApp56\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:314:6
callFunctionReturnFlushedQueue
D:\MobileApp56\node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:115:17

close button not working in ios

in android close button working fine. but in ios close button is not working..not even click is happening in touchableopacity

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.