Skip to content

Commit

Permalink
Merge pull request #40 from vntchain/feat/github_doc_link
Browse files Browse the repository at this point in the history
Feat/GitHub doc link
  • Loading branch information
zhouxsss committed Mar 13, 2020
2 parents f9bcfb8 + e1c3642 commit 5e46d12
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 15 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# VNT Explorer 前端运行指南

## 下载代码

```bash
git clone https://github.com/vntchain/vnt-explorer-front.git
```

## 安装 npm

- [Get npm](https://www.npmjs.com/get-npm)

## 安装依赖

```bash
npm install
```

## 配置环境变量

- `./env` 文件

```
Expand All @@ -32,11 +36,7 @@ npm install

- `./env` 文件
```js
REACT_APP_NET= // mainnet testnet
```
- `src/assets/_base.scss`文件
```js
$net: // testnet mainnet
REACT_APP_NET= // mainnet testnet
```

## 运行
Expand All @@ -49,26 +49,26 @@ npm start

步骤:

* 项目地址更新最新代码
- 项目地址更新最新代码

```bash
git pull
```

* 编译代码,并去除js map文件
- 编译代码,并去除 js map 文件

```bash
npm run build
rm build/static/js/*.map
```

* 复制build内容到部署地址
- 复制 build 内容到部署地址

```bash
cp -r <origin path> <target path>
```

* 重启nginx
- 重启 nginx

```bash
nginx -s reload
Expand Down
5 changes: 4 additions & 1 deletion config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ module.exports = {
},
},
{
loader: require.resolve('sass-loader')
loader: require.resolve('sass-loader'),
options: {
data: `$net: ${process.env.REACT_APP_NET==='mainnet'? 'mainnet': 'testnet'};`
}
},
{
loader: require.resolve('postcss-loader'),
Expand Down
5 changes: 4 additions & 1 deletion config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,10 @@ module.exports = {
},
},
{
loader: require.resolve('sass-loader')
loader: require.resolve('sass-loader'),
options: {
data: `$net: ${process.env.REACT_APP_NET==='mainnet'? 'mainnet': 'testnet'};`
}
},
{
loader: require.resolve('postcss-loader'),
Expand Down
2 changes: 1 addition & 1 deletion src/assets/_base.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$net: testnet;
/* $net: testnet; // delete this due to config of sass-loader in webpack.config */
/* colors */
$color-primary: if($net == "mainnet", #3389ff, #4cc159);
$color-primary-light: if($net == "mainnet", #65b6ff, #4cc159);
Expand Down
14 changes: 12 additions & 2 deletions src/containers/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default withRouter(
filterParam = `&${a[1]}`
}
//console.log(a,index) //eslint-disable-line
if(index < 0){
if (index < 0) {
a.pop()
props.dispatch(replace(`/${a.join('/')}/1`))
index = 1
Expand All @@ -109,7 +109,17 @@ export default withRouter(
{location.pathname.startsWith(r.devGuides) && (
<div className={styles.strTitle}>
<h2>
<LocalText id="dgTitle" />
<span>
<LocalText id="dgTitle" />
</span>
<a
href={
'https://github.com/vntchain/vnt-documentation/tree/master/developer-guide'
}
target="_blank"
>
<LocalText id="dgExtra" />
</a>
</h2>
</div>
)}
Expand Down
13 changes: 12 additions & 1 deletion src/containers/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,23 @@
width: 12rem;
}
h2 {
display: flex;
justify-content: space-between;
align-items: center;
color: #fff;
padding: 0.3rem 0;
padding: 0.26rem 0;
font-size: 0.18rem;
margin-bottom: 0;
width: 12rem;

a {
padding: 0.08rem 0.12rem;
color: #fff;
font-size: 0.12rem;
border: 1px solid #fff;
border-radius: 0.04rem;
}

@include respondTo($bp-desktop) {
padding-left: 0.3rem;
}
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locale/cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ export default {
** Developer guide page
*/
dgTitle: 'VNT开发者指南',
dgExtra: '去github上查阅开发者文档',
dgNav1: 'VNT介绍',
dgNav2: '网络搭建',
dgNav3: '共识投票',
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ export default {
** Developer guide page
*/
dgTitle: 'VNT Developer Guidlines',
dgExtra: 'Go to developer documentation on GitHub',
dgNav1: 'VNT Introduction',
dgNav2: 'Network Setup',
dgNav3: 'Vote and Consensus',
Expand Down

0 comments on commit 5e46d12

Please sign in to comment.