import App from 'next/app';
import React from 'react';
import { ThemeProvider } from 'styled-components';
import { ToastProvider } from 'react-toast-notifications';
import { StoreProvider } from '../store';

import theme from '../helpers/theme';

import '../i18n';
import '../helpers/globalStyles.css';

class MainApp extends App {
  render() {
    const { Component, pageProps } = this.props;

    return (
      <StoreProvider>
        <ToastProvider placement="bottom-center">
          <ThemeProvider theme={theme}>
            <Component {...pageProps} />
          </ThemeProvider>
        </ToastProvider>
      </StoreProvider>
    );
  }
}

export default MainApp;
