next/app#Container TypeScript Examples

The following examples show how to use next/app#Container. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: _app.tsx    From panvala with Apache License 2.0 5 votes vote down vote up
render() {
    const { Component, pageProps }: IProps = this.props;
    const { hasError, errorCode }: IState = this.state;

    if (hasError && errorCode) {
      return <ErrorPage statusCode={errorCode} />;
    }

    // If this is a liveness check, do not render the full context. We just want to check that
    // the application is running.
    if (typeof pageProps.asPath !== 'undefined' && pageProps.asPath.startsWith('/liveness')) {
      return <Component {...pageProps} />;
    }

    return (
      <Container>
        <EthereumProvider>
          <MainProvider>
            <NotificationsProvider>
              <ThemeProvider theme={theme}>
                <Layout title={pageProps.title || 'Panvala Disputes'}>
                  <Component {...pageProps} />
                </Layout>
              </ThemeProvider>
            </NotificationsProvider>
          </MainProvider>
        </EthereumProvider>
        <ToastContainer
          position="bottom-right"
          autoClose={false}
          hideProgressBar={true}
          newestOnTop={false}
          rtl={false}
          draggable={false}
          closeOnClick
          pauseOnHover
        />
      </Container>
    );
  }