aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/index.js
blob: c2d2b6b777f9d68f0e43a3b32d417f426dd1d58e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import React, { lazy, Suspense } from 'react';
import ReactDOM from 'react-dom';

function LoadingView(props) {
  return (
    <>
      <div id="header">
        <div id="header_wrapper">
          <div id="logo">
            <a href="/">Juick</a>
          </div>
          <div id="search">
            <form>
              <input name="search" className="text" placeholder="Search..." />
            </form>
          </div>
          <nav id="global">
            <a href="/">Loading...</a>
          </nav>
        </div>
      </div>
      <div id="wrapper">
        <div id="content">
          <div className="lds-ripple"><div></div><div></div></div>
        </div>
      </div>
    </>
  );
}

const Juick = lazy(() => import('./App'));

const JuickApp = () => (
  <Suspense fallback={LoadingView()}>
    <Juick />
  </Suspense>
);

ReactDOM.render(<JuickApp />, document.getElementById('app'));