Skip to content
This repository was archived by the owner on Apr 20, 2020. It is now read-only.

Commit e510993

Browse files
authored
Merge pull request #7 from cryptape/develop
add CDN address in docs
2 parents b9e3bfa + fb4ad34 commit e510993

Some content is hidden

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

41 files changed

+813
-3888
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ module.exports = {
232232
'jsx-a11y/click-events-have-key-events': [0],
233233
'jsx-a11y/no-static-element-interactions': [0],
234234
'no-nested-ternary': [0],
235+
'no-underscore-dangle': [0]
235236
},
236237
settings: {
237238
'import/resolver': {

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ CHAIN_SERVERS= # default appchain addresses
3232
APP_NAME= # explorer name
3333
```
3434

35+
> NOTICE: Our CDN for static assets is available at `http://pccoq959o.bkt.clouddn.com/`, namely icons and images can be added by setting `PUBLIC=http://pccoq959o.bkt.clouddn.com/` on `.env`.
36+
3537
5. Developing
3638

3739
```shell

docs/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
<nav class="app-nav no-badge">
2222
<ul>
2323
<li>
24-
<a href="https://cryptape.github.io/Nervos-Docs">Nervos</a>
24+
<a href="https://docs.nervos.org/" target="_about">Nervos</a>
2525
<ul>
2626
<li>
27-
<a href="https://cryptape.github.io/Nervos-AppChain-Docs/">AppChain</a>
27+
<a href="https://cryptape.github.io/Nervos-AppChain-Docs/" target="_about">AppChain</a>
2828
</li>
2929
<li>
30-
<a href="https://cryptape.github.io/cita/">CITA</a>
30+
<a href="https://cryptape.github.io/cita/" target="_about">CITA</a>
3131
</li>
3232
<li>
33-
<a href="https://cryptape.github.io/Neuron-Android/#/">Neuron</a>
33+
<a href="https://cryptape.github.io/Neuron-Android/#/" target="_about">Neuron</a>
3434
</li>
3535
<li>
3636
<a href="https://cryptape.github.io/Microscope/">Microscope</a>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"@material-ui/core": "^1.2.0",
3030
"@material-ui/icons": "^1.1.0",
3131
"@nervos/observables": "^0.17.1",
32+
"@nervos/signer": "^1.0.23",
3233
"@reactivex/rxjs": "^5.5.6",
3334
"axios": "^0.18.0",
3435
"echarts": "^4.0.4",

src/App.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
/*
2+
* @Author: Keith-CY
3+
* @Date: 2018-07-22 19:56:35
4+
* @Last Modified by: Keith-CY
5+
* @Last Modified time: 2018-07-22 19:57:36
6+
*/
7+
18
import * as React from 'react'
2-
import 'normalize.css'
39
import { HashRouter as Router } from 'react-router-dom'
410
import { MuiThemeProvider } from '@material-ui/core/styles'
11+
512
import Routes from './Routes'
613
import theme from './config/theme'
14+
715
import { provideObservabls } from './contexts/observables'
816
import { provideConfig } from './contexts/config'
917

Lines changed: 13 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import * as React from 'react'
2-
import { HashRouter as Router, Route } from 'react-router-dom'
3-
import Bundle from './components/Bundle'
4-
5-
export const containers = [
1+
export default [
62
{ path: '/', name: 'Header', component: 'Header', nav: false },
73
{
84
path: '/',
@@ -32,8 +28,9 @@ export const containers = [
3228
exact: true,
3329
nav: true,
3430
icon: `${process.env.PUBLIC}/microscopeIcons/mobile_navs/block.svg`,
35-
iconActive:
36-
`${process.env.PUBLIC}/microscopeIcons/mobile_navs/block_active.svg`,
31+
iconActive: `${
32+
process.env.PUBLIC
33+
}/microscopeIcons/mobile_navs/block_active.svg`,
3734
},
3835
{
3936
path: '/transactions',
@@ -42,9 +39,9 @@ export const containers = [
4239
exact: true,
4340
nav: true,
4441
icon: `${process.env.PUBLIC}/microscopeIcons/mobile_navs/transaction.svg`,
45-
iconActive:
46-
`${process.env.PUBLIC
47-
}/microscopeIcons/mobile_navs/transaction_active.svg`,
42+
iconActive: `${
43+
process.env.PUBLIC
44+
}/microscopeIcons/mobile_navs/transaction_active.svg`,
4845
},
4946
{
5047
path: '/transaction/:transaction',
@@ -67,8 +64,9 @@ export const containers = [
6764
exact: true,
6865
nav: true,
6966
icon: `${process.env.PUBLIC}/microscopeIcons/mobile_navs/statistics.svg`,
70-
iconActive:
71-
`${process.env.PUBLIC}/microscopeIcons/mobile_navs/statistics_active.svg`,
67+
iconActive: `${
68+
process.env.PUBLIC
69+
}/microscopeIcons/mobile_navs/statistics_active.svg`,
7270
},
7371
{
7472
path: '/config',
@@ -77,46 +75,9 @@ export const containers = [
7775
exact: true,
7876
nav: true,
7977
icon: `${process.env.PUBLIC}/microscopeIcons/mobile_navs/config.svg`,
80-
iconActive:
81-
`${process.env.PUBLIC}/microscopeIcons/mobile_navs/config_active.svg`,
78+
iconActive: `${
79+
process.env.PUBLIC
80+
}/microscopeIcons/mobile_navs/config_active.svg`,
8281
},
8382
{ path: '/', name: 'Footer', component: 'Footer', exact: false, nav: false },
8483
]
85-
86-
const asyncRender = mod => routerProps => {
87-
if (!mod) return null
88-
/* eslint-disable */
89-
const Component = require(`bundle-loader?lazy!./containers/${mod}`)
90-
/* eslint-enable */
91-
return (
92-
<Bundle load={Component}>
93-
{Comp => (Comp ? <Comp {...routerProps} /> : <div>Loading</div>)}
94-
</Bundle>
95-
)
96-
}
97-
/* eslint-enable import/no-dynamic-require */
98-
/* eslint-enable global-require */
99-
100-
export const renderRouteArray = containerArr =>
101-
containerArr.map(container => (
102-
<Route
103-
key={container.name}
104-
{...container}
105-
render={asyncRender(container.component)}
106-
/>
107-
))
108-
109-
const Routes = () => (
110-
<React.Fragment>
111-
{containers.map(container => (
112-
<Route
113-
key={container.name}
114-
path={container.path}
115-
exact={container.exact}
116-
render={asyncRender(container.component)}
117-
/>
118-
))}
119-
</React.Fragment>
120-
)
121-
122-
export default Routes

src/Routes/index.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* @Author: Keith-CY
3+
* @Date: 2018-07-22 19:59:10
4+
* @Last Modified by: Keith-CY
5+
* @Last Modified time: 2018-07-22 20:10:55
6+
*/
7+
8+
import * as React from 'react'
9+
import { Route } from 'react-router-dom'
10+
11+
import Bundle from '../components/Bundle'
12+
import containers from './containers'
13+
14+
export const asyncRender = mod => routerProps => {
15+
if (!mod) return null
16+
/* eslint-disable */
17+
const Component = require(`bundle-loader?lazy!../containers/${mod}`)
18+
/* eslint-enable */
19+
return (
20+
<Bundle load={Component}>
21+
{Comp => (Comp ? <Comp {...routerProps} /> : <div>Loading</div>)}
22+
</Bundle>
23+
)
24+
}
25+
/* eslint-enable import/no-dynamic-require */
26+
/* eslint-enable global-require */
27+
28+
const Routes = () => (
29+
<React.Fragment>
30+
{containers.map(container => (
31+
<Route
32+
key={container.name}
33+
path={container.path}
34+
exact={container.exact}
35+
render={asyncRender(container.component)}
36+
/>
37+
))}
38+
</React.Fragment>
39+
)
40+
41+
export default Routes

src/config/colors.ts

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

src/config/graph.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ export const LineOption = {
3030
colorStops: [
3131
{
3232
offset: 0,
33-
color: 'red', // 0% 处的颜色
33+
color: 'red',
3434
},
3535
{
3636
offset: 1,
37-
color: 'blue', // 100% 处的颜色
37+
color: 'blue',
3838
},
3939
],
40-
globalCoord: false, // 缺省为 false
40+
globalCoord: false,
4141
},
4242
}
4343
export const PieOption = {

src/config/i18n.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1+
/*
2+
* @Author: Keith-CY
3+
* @Date: 2018-07-22 21:38:14
4+
* @Last Modified by: Keith-CY
5+
* @Last Modified time: 2018-07-22 21:38:14
6+
*/
7+
18
import * as i18n from 'i18next'
29
import * as XHR from 'i18next-xhr-backend'
310
import * as LanguageDetector from 'i18next-browser-languagedetector'
411
import { reactI18nextModule } from 'react-i18next'
5-
// import zh from './locale/translation.zh.json'
6-
// import en from './locale/en'
712

813
i18n
914
.use(XHR)
1015
.use(LanguageDetector)
1116
.use(reactI18nextModule)
1217
.init({
1318
fallbackLng: 'en',
14-
// defaultNS: 'translations',
1519
keySeparator: false,
1620
react: {
1721
wait: false,

0 commit comments

Comments
 (0)