File tree Expand file tree Collapse file tree 7 files changed +44
-39
lines changed
Expand file tree Collapse file tree 7 files changed +44
-39
lines changed Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+ import { BrowserRouter as Router , Switch , Route } from 'react-router-dom' ;
3+ import { PreviewEventsProvider } from './context/PreviewEvents' ;
4+ import Loader from './components/Loader' ;
5+
6+ const Playground = React . lazy ( ( ) => import ( './pages/Playground' ) ) ;
7+ const Embedded = React . lazy ( ( ) => import ( './pages/Embedded' ) ) ;
8+
9+ function App ( ) {
10+ return (
11+ < Router >
12+ < PreviewEventsProvider >
13+ < React . Suspense fallback = { < Loader /> } >
14+ < Switch >
15+ < Route path = "/embed/:gistId?/:gistVersion?" component = { Embedded } />
16+ < Route
17+ path = { [ '/gist/:gistId/:gistVersion?' , '/' ] }
18+ component = { Playground }
19+ />
20+ </ Switch >
21+ </ React . Suspense >
22+ </ PreviewEventsProvider >
23+ </ Router >
24+ ) ;
25+ }
26+
27+ export default App ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import React , { useEffect , useState } from 'react' ;
22import Input from './Input' ;
33import CopyButton from './CopyButton' ;
4- import Embedded from './Embedded' ;
4+ import Embedded from '../pages /Embedded' ;
55import { SyncIcon , XIcon } from '@primer/octicons-react' ;
66
77import { defaultPanes } from '../constants' ;
Original file line number Diff line number Diff line change 11import 'regenerator-runtime/runtime' ;
2- import React from 'react' ;
3- import ReactDOM from 'react-dom' ;
4- import App from './components/App' ;
5- import 'regenerator-runtime/runtime' ;
62import 'react-toastify/dist/ReactToastify.min.css' ;
73import './service-worker' ;
84
5+ import React from 'react' ;
6+ import ReactDOM from 'react-dom' ;
7+
8+ import App from './App' ;
9+
910ReactDOM . render ( < App /> , document . getElementById ( 'app' ) ) ;
Original file line number Diff line number Diff line change 11import React , { useEffect } from 'react' ;
22import queryString from 'query-string' ;
33import { useLocation , useParams } from 'react-router-dom' ;
4- import Preview from './Preview' ;
5- import Query from './Query' ;
6- import Result from './Result' ;
7- import MarkupEditor from './MarkupEditor' ;
4+ import Preview from '../components /Preview' ;
5+ import Query from '../components /Query' ;
6+ import Result from '../components /Result' ;
7+ import MarkupEditor from '../components /MarkupEditor' ;
88import useParentMessaging from '../hooks/useParentMessaging' ;
99import usePlayground from '../hooks/usePlayground' ;
10- import Loader from './Loader' ;
10+ import Loader from '../components /Loader' ;
1111
1212import { defaultPanes } from '../constants' ;
1313
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { useParams } from 'react-router-dom' ;
3- import Preview from './Preview' ;
4- import MarkupEditor from './MarkupEditor' ;
3+ import Preview from '../components /Preview' ;
4+ import MarkupEditor from '../components /MarkupEditor' ;
55import usePlayground from '../hooks/usePlayground' ;
6- import Layout from './Layout' ;
7- import Loader from './Loader' ;
8- import PlaygroundPanels from './PlaygroundPanels' ;
6+ import Layout from '../components /Layout' ;
7+ import Loader from '../components /Loader' ;
8+ import PlaygroundPanels from '../components /PlaygroundPanels' ;
99import { usePreviewEvents } from '../context/PreviewEvents' ;
1010
1111function Playground ( ) {
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import { render } from '@testing-library/react' ;
3- import Playground from './App' ;
3+ import Playground from '.. /App' ;
44
55describe ( 'App' , ( ) => {
66 it ( 'should not throw on render' , ( ) => {
You can’t perform that action at this time.
0 commit comments