Skip to content

Commit

Permalink
[Chore] Tidy up (#208)
Browse files Browse the repository at this point in the history
* Update PR template

* Update the github workflows

* Tidy up the .env files

* Reset `package.json#version` and remove CHANGELOG.md

* Use env-var to control Transfer page visibility

* Re-add `.env.test` for GitHub
  • Loading branch information
ken-futureverse authored Jul 25, 2022
1 parent 26a3caa commit 6675a51
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 86 deletions.
5 changes: 0 additions & 5 deletions .env.development

This file was deleted.

5 changes: 0 additions & 5 deletions .env.production

This file was deleted.

6 changes: 6 additions & 0 deletions .env.skel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ENABLE_TRANSFERS_TAB=
NEXT_PUBLIC_ALLOWED_ASSET_IDS=
NEXT_PUBLIC_CENNZ_ASSET_ID=
NEXT_PUBLIC_CENNZ_NETWORK=
NEXT_PUBLIC_CPAY_ASSET_ID=
NEXT_PUBLIC_GA_ID=
5 changes: 3 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
NEXT_PUBLIC_ENABLE_TRANSFERS_TAB=1
NEXT_PUBLIC_ALLOWED_ASSET_IDS=16000,16001
NEXT_PUBLIC_CENNZ_ASSET_ID=16000
NEXT_PUBLIC_CENNZ_NETWORK=rata
NEXT_PUBLIC_CPAY_ASSET_ID=16001
NEXT_PUBLIC_ALLOWED_ASSET_IDS=16000,16001
NEXT_PUBLIC_GA_ID=
NEXT_PUBLIC_CENNZ_NETWORK=nikau
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Why
## Summary

> _Summary of the change in one short paragraph._
## What is changing
## Changes

> _Details of the change in bullet points._
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/labeled_deployment.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/ci.yml → .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
name: PR

on:
push:
branches:
- develop
- "prod/**"
pull_request:
branches:
- develop
- "prod/**"

workflow_dispatch:

Expand Down
35 changes: 0 additions & 35 deletions CHANGELOG.md

This file was deleted.

16 changes: 10 additions & 6 deletions libs/components/AppSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Theme } from "@mui/material";
import { useSectionUri } from "@/libs/hooks";
import { useMetaMaskExtension } from "@/libs/providers/MetaMaskExtensionProvider";
import { ensureEthereumChain } from "@/libs/utils";
import { ENABLE_TRANSFERS_TAB } from "@/libs/constants";

const Switch: FC = () => {
const section = useSectionUri();
Expand Down Expand Up @@ -33,11 +34,14 @@ const Switch: FC = () => {
<span>Bridge</span>
</a>
</Link>
{/*<Link href="/transfer" passHref={true}>
<a css={styles.navItem(section === "transfer")}>
<span>Transfer</span>
</a>
</Link>*/}

{ENABLE_TRANSFERS_TAB && (
<Link href="/transfer" passHref={true}>
<a css={styles.navItem(section === "transfer")}>
<span>Transfer</span>
</a>
</Link>
)}
</nav>
);
};
Expand All @@ -46,7 +50,7 @@ export default Switch;

export const styles = {
container: ({ shadows }: Theme) => css`
width: 360px;
width: ${ENABLE_TRANSFERS_TAB ? "30em" : "360px"};
display: flex;
flex-direction: row;
justify-content: center;
Expand Down
3 changes: 3 additions & 0 deletions libs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,6 @@ export const ETHEREUM_NETWORK = {
PegAddress: "0x76BAc85e1E82cd677faa2b3f00C4a2626C4c6E32",
},
}[process.env.NEXT_PUBLIC_ETHEREUM_NETWORK ?? CENNZ_NETWORK.LinkedEthChain];

export const ENABLE_TRANSFERS_TAB =
process.env.NEXT_PUBLIC_ENABLE_TRANSFERS_TAB === "1";
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cennznet/app-hub",
"version": "1.2.0",
"version": "0.0.0",
"private": true,
"scripts": {
"clean": "rm -rdf .next",
Expand Down
7 changes: 6 additions & 1 deletion pages/transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ import {
TransferProgress,
} from "@/libs/components";
import { Api } from "@cennznet/api";
import { CENNZ_NETWORK } from "@/libs/constants";
import { CENNZ_NETWORK, ENABLE_TRANSFERS_TAB } from "@/libs/constants";

import { fetchCENNZAssets } from "@/libs/utils";
import { CENNZAssets } from "@/libs/types";

export async function getStaticProps() {
if (!ENABLE_TRANSFERS_TAB)
return {
notFound: true,
};

const api = await Api.create({ provider: CENNZ_NETWORK.ApiUrl.InWebSocket });

return {
Expand Down

1 comment on commit 6675a51

@vercel
Copy link

@vercel vercel bot commented on 6675a51 Jul 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app-hub – ./

app-hub-git-prod-main-cennznet.vercel.app
app-hub-cennznet.vercel.app
app-hub-theta.vercel.app

Please sign in to comment.