import * as React from 'react';
import { createStore, combineReducers, applyMiddleware } from 'redux'
import logger from 'redux-logger'
import { default as thunk } from 'redux-thunk'
import { Provider } from 'react-redux'
import { composeWithDevTools } from 'redux-devtools-extension';
import { StyleSheet, View } from 'react-native';
import {
    Drawer,
    Text,
    Form,
    TextInput,
    Header,
    createCosmoUiReducersWithTheme,
    FormState,
    DropdownState,
    defaultTheme,
} from './components'

const store = createStore(
    combineReducers({
        ...createCosmoUiReducersWithTheme(defaultTheme),
    }),
    applyMiddleware(
        logger,
        thunk,
    ),
)

const DRAWER_KEY = 'COSMO_UI_ANDROID_DRAWER'

export default class App extends React.Component<any, any> {
    public render() {
        return (
            <Provider store={store}>
                <Drawer name={DRAWER_KEY}>
                    <Text>Vote for leader of the month</Text>
                    <Form name="exampleForm">
                        <TextInput
                            placeholder="Your nomination"
                            name="exampleTextInput" />
                    </Form>
                </Drawer>
            </Provider>
        )
    }
}
