import React from 'react'
import { NavigationContainer } from '@react-navigation/native'
import { Provider } from 'react-redux'
import StackRoutes from './stack.routes'
import store from '../store'
import { ThemeProvider } from 'styled-components/native'
import theme from '~/global/styles/theme'
import RNBootSplash from 'react-native-bootsplash'

const Routes: React.FC = () => {
  return (
    <Provider store={store}>
      <ThemeProvider theme={theme}>
        <NavigationContainer onReady={() => RNBootSplash.hide()}>
          <StackRoutes />
        </NavigationContainer>
      </ThemeProvider>
    </Provider>
  )
}

export default Routes
