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 1
1
import React , { useEffect , useState } from 'react' ;
2
2
import Input from './Input' ;
3
3
import CopyButton from './CopyButton' ;
4
- import Embedded from './Embedded' ;
4
+ import Embedded from '../pages /Embedded' ;
5
5
import { SyncIcon , XIcon } from '@primer/octicons-react' ;
6
6
7
7
import { defaultPanes } from '../constants' ;
Original file line number Diff line number Diff line change 1
1
import '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' ;
6
2
import 'react-toastify/dist/ReactToastify.min.css' ;
7
3
import './service-worker' ;
8
4
5
+ import React from 'react' ;
6
+ import ReactDOM from 'react-dom' ;
7
+
8
+ import App from './App' ;
9
+
9
10
ReactDOM . render ( < App /> , document . getElementById ( 'app' ) ) ;
Original file line number Diff line number Diff line change 1
1
import React , { useEffect } from 'react' ;
2
2
import queryString from 'query-string' ;
3
3
import { 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' ;
8
8
import useParentMessaging from '../hooks/useParentMessaging' ;
9
9
import usePlayground from '../hooks/usePlayground' ;
10
- import Loader from './Loader' ;
10
+ import Loader from '../components /Loader' ;
11
11
12
12
import { defaultPanes } from '../constants' ;
13
13
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { 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' ;
5
5
import 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' ;
9
9
import { usePreviewEvents } from '../context/PreviewEvents' ;
10
10
11
11
function Playground ( ) {
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
import { render } from '@testing-library/react' ;
3
- import Playground from './App' ;
3
+ import Playground from '.. /App' ;
4
4
5
5
describe ( 'App' , ( ) => {
6
6
it ( 'should not throw on render' , ( ) => {
You can’t perform that action at this time.
0 commit comments