1.0.8 • Published 7 years ago

react-native-animated-drawer v1.0.8

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

React native animated drawer

React native drawer using react native Animated.

This package currently contains a bare minimum. Feel free to add features and make pull requests.

Usage:

import * as React from "react";
import Sidebar from "../components/Sidebar";
import {Text, View} from 'react-native';

interface State {
    isOpen: boolean,
}

class HomeScreen extends React.Component<{}, State> {

    constructor(props: any) {
        super(props);
        this.state = {isOpen: false};
    }

    renderContent() {
        return <View style={{backgroundColor: 'green', flex: 1}}>
            {new Array(10).fill(0).map((o, i) => <Text key={i}>Content</Text>)}
        </View>
    }

    renderSidebar() {
        return <View style={{backgroundColor: 'red', flex: 1}}>
            <Text>Sidebar content</Text>
        </View>
    }

    render() {
        return <Sidebar
            shouldOpen={() => this.setState({isOpen: true})}
            shouldClose={() => this.setState({isOpen: false})}
            isOpen={this.state.isOpen}
            content={this.renderContent()}
            sidebarContent={this.renderSidebar()}
        />
    }

}

export default HomeScreen;
1.0.8

7 years ago

1.0.7

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago