Skip to content

Commit 9d34c15

Browse files
author
pichid
committed
update
1 parent b7d8029 commit 9d34c15

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1385
-8486
lines changed

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

REACT.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 174 deletions
This file was deleted.

src/App.js

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,59 @@
1-
import React, { Component } from 'react';
2-
import { HashRouter, Route, Switch } from 'react-router-dom';
3-
import './scss/style.scss';
1+
import React, { Component } from "react";
2+
import { HashRouter, Route, Switch } from "react-router-dom";
3+
import "./scss/style.scss";
44

55
const loading = (
66
<div className="pt-3 text-center">
77
<div className="sk-spinner sk-spinner-pulse"></div>
88
</div>
9-
)
9+
);
1010

1111
// Containers
12-
const TheLayout = React.lazy(() => import('./containers/TheLayout'));
12+
const TheLayout = React.lazy(() => import("./containers/TheLayout"));
1313

1414
// Pages
15-
const Login = React.lazy(() => import('./views/pages/login/Login'));
16-
const Register = React.lazy(() => import('./views/pages/register/Register'));
17-
const Page404 = React.lazy(() => import('./views/pages/page404/Page404'));
18-
const Page500 = React.lazy(() => import('./views/pages/page500/Page500'));
15+
const Login = React.lazy(() => import("./views/pages/login/Login"));
16+
const Register = React.lazy(() => import("./views/pages/register/Register"));
17+
const Page404 = React.lazy(() => import("./views/pages/page404/Page404"));
18+
const Page500 = React.lazy(() => import("./views/pages/page500/Page500"));
1919

2020
class App extends Component {
21-
2221
render() {
2322
return (
2423
<HashRouter>
25-
<React.Suspense fallback={loading}>
26-
<Switch>
27-
<Route exact path="/login" name="Login Page" render={props => <Login {...props}/>} />
28-
<Route exact path="/register" name="Register Page" render={props => <Register {...props}/>} />
29-
<Route exact path="/404" name="Page 404" render={props => <Page404 {...props}/>} />
30-
<Route exact path="/500" name="Page 500" render={props => <Page500 {...props}/>} />
31-
<Route path="/" name="Home" render={props => <TheLayout {...props}/>} />
32-
</Switch>
33-
</React.Suspense>
24+
<React.Suspense fallback={loading}>
25+
<Switch>
26+
<Route
27+
exact
28+
path="/login"
29+
name="Login Page"
30+
render={(props) => <Login {...props} />}
31+
/>
32+
<Route
33+
exact
34+
path="/register"
35+
name="Register Page"
36+
render={(props) => <Register {...props} />}
37+
/>
38+
<Route
39+
exact
40+
path="/404"
41+
name="Page 404"
42+
render={(props) => <Page404 {...props} />}
43+
/>
44+
<Route
45+
exact
46+
path="/500"
47+
name="Page 500"
48+
render={(props) => <Page500 {...props} />}
49+
/>
50+
<Route
51+
path="/"
52+
name="Home"
53+
render={(props) => <TheLayout {...props} />}
54+
/>
55+
</Switch>
56+
</React.Suspense>
3457
</HashRouter>
3558
);
3659
}

src/App.test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import React from 'react';
2-
import {shallow} from 'enzyme/build';
3-
import App from './App';
1+
import React from "react";
2+
import { shallow } from "enzyme/build";
3+
import App from "./App";
44

5-
6-
it('mounts without crashing', () => {
5+
it("mounts without crashing", () => {
76
const wrapper = shallow(<App />);
8-
wrapper.unmount()
7+
wrapper.unmount();
98
});

src/containers/TheContent.js

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
import React, { Suspense } from 'react'
2-
import {
3-
Redirect,
4-
Route,
5-
Switch
6-
} from 'react-router-dom'
7-
import { CContainer, CFade } from '@coreui/react'
1+
import React, { Suspense } from "react";
2+
import { Redirect, Route, Switch } from "react-router-dom";
3+
import { CContainer, CFade } from "@coreui/react";
84

95
// routes config
10-
import routes from '../routes'
11-
6+
import routes from "../routes";
7+
128
const loading = (
139
<div className="pt-3 text-center">
1410
<div className="sk-spinner sk-spinner-pulse"></div>
1511
</div>
16-
)
12+
);
1713

1814
const TheContent = () => {
1915
return (
@@ -22,25 +18,28 @@ const TheContent = () => {
2218
<Suspense fallback={loading}>
2319
<Switch>
2420
{routes.map((route, idx) => {
25-
return route.component && (
26-
<Route
27-
key={idx}
28-
path={route.path}
29-
exact={route.exact}
30-
name={route.name}
31-
render={props => (
32-
<CFade>
33-
<route.component {...props} />
34-
</CFade>
35-
)} />
36-
)
21+
return (
22+
route.component && (
23+
<Route
24+
key={idx}
25+
path={route.path}
26+
exact={route.exact}
27+
name={route.name}
28+
render={(props) => (
29+
<CFade>
30+
<route.component {...props} />
31+
</CFade>
32+
)}
33+
/>
34+
)
35+
);
3736
})}
3837
<Redirect from="/" to="/dashboard" />
3938
</Switch>
4039
</Suspense>
4140
</CContainer>
4241
</main>
43-
)
44-
}
42+
);
43+
};
4544

46-
export default React.memo(TheContent)
45+
export default React.memo(TheContent);

0 commit comments

Comments
 (0)