diff --git a/package.json b/package.json
index 2cf7abe0..12243dc9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,7 @@
{
"name": "bridge-v2",
"version": "0.1.0",
+ "homepage": "https://renproject.github.io/bridge-v2",
"private": true,
"dependencies": {
"@babel/helper-call-delegate": "^7.12.1",
@@ -61,6 +62,8 @@
"blake2b": "2.1.3"
},
"scripts": {
+ "predeploy": "REACT_APP_GH_PAGES=true yarn run build",
+ "deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
@@ -70,11 +73,7 @@
"extends": "react-app"
},
"browserslist": {
- "production": [
- ">0.2%",
- "not dead",
- "not op_mini all"
- ],
+ "production": [">0.2%", "not dead", "not op_mini all"],
"development": [
"last 1 chrome version",
"last 1 firefox version",
@@ -82,6 +81,7 @@
]
},
"devDependencies": {
+ "gh-pages": "^3.1.0",
"netlify-cli": "^2.71.0"
}
}
diff --git a/public/404.html b/public/404.html
new file mode 100644
index 00000000..47c4a1d7
--- /dev/null
+++ b/public/404.html
@@ -0,0 +1,40 @@
+
+
+
+
+ Single Page Apps for GitHub Pages
+
+
+
+
+
diff --git a/public/index.html b/public/index.html
index 15c69850..28d8c5d1 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,6 +1,28 @@
+
+
}>
diff --git a/public/background.svg b/src/assets/backgrounds/background.svg
similarity index 100%
rename from public/background.svg
rename to src/assets/backgrounds/background.svg
diff --git a/src/constants/environmentVariables.ts b/src/constants/environmentVariables.ts
index 8f7f6180..f42c53e0 100644
--- a/src/constants/environmentVariables.ts
+++ b/src/constants/environmentVariables.ts
@@ -14,6 +14,8 @@ const XSTATE_DEVTOOLS = Boolean(
process.env.NODE_ENV === "development"
);
+const GH_PAGES = Boolean(process.env.REACT_APP_GH_PAGES);
+
export const env = {
NETWORK,
INFURA_KEY,
@@ -22,6 +24,7 @@ export const env = {
BANDCHAIN_ENDPOINT,
GAS_FEE_ENDPOINT,
XSTATE_DEVTOOLS,
+ GH_PAGES,
};
console.debug("env", env, process);
diff --git a/src/index.css b/src/index.css
index 7de72672..e0114c6b 100644
--- a/src/index.css
+++ b/src/index.css
@@ -16,7 +16,7 @@ body::before {
left: 0;
bottom: 0;
right: 0;
- background-image: url("/background.svg");
+ background-image: url(./assets/backgrounds/background.svg);
background-position: 50% 50%;
transition: all 1s ease-in-out;
background-size: 100% 100%;
diff --git a/yarn.lock b/yarn.lock
index 8d7f5597..9d65842c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4314,7 +4314,7 @@ async@^1.4.2:
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=
-async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.2:
+async@^2.0.1, async@^2.1.2, async@^2.4.0, async@^2.5.0, async@^2.6.1, async@^2.6.2:
version "2.6.3"
resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff"
integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==
@@ -5880,7 +5880,7 @@ comma-separated-tokens@^1.0.0:
resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea"
integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw==
-commander@^2.11.0, commander@^2.15.0, commander@^2.20.0, commander@^2.20.3, commander@^2.3.0, commander@^2.8.1:
+commander@^2.11.0, commander@^2.15.0, commander@^2.18.0, commander@^2.20.0, commander@^2.20.3, commander@^2.3.0, commander@^2.8.1:
version "2.20.3"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
@@ -7287,6 +7287,11 @@ elliptic@^6.4.0, elliptic@^6.5.2, elliptic@^6.5.3:
minimalistic-assert "^1.0.1"
minimalistic-crypto-utils "^1.0.1"
+email-addresses@^3.0.1:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/email-addresses/-/email-addresses-3.1.0.tgz#cabf7e085cbdb63008a70319a74e6136188812fb"
+ integrity sha512-k0/r7GrWVL32kZlGwfPNgB2Y/mMXVTq/decgLczm/j34whdaspNrZO8CnXPf1laaHxI6ptUlsnAxN+UAPw+fzg==
+
emoji-regex@^7.0.1, emoji-regex@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
@@ -8435,11 +8440,33 @@ file-uri-to-path@1.0.0:
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
+filename-reserved-regex@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/filename-reserved-regex/-/filename-reserved-regex-1.0.0.tgz#e61cf805f0de1c984567d0386dc5df50ee5af7e4"
+ integrity sha1-5hz4BfDeHJhFZ9A4bcXfUO5a9+Q=
+
filename-reserved-regex@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/filename-reserved-regex/-/filename-reserved-regex-2.0.0.tgz#abf73dfab735d045440abfea2d91f389ebbfa229"
integrity sha1-q/c9+rc10EVECr/qLZHzieu/oik=
+filenamify-url@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/filenamify-url/-/filenamify-url-1.0.0.tgz#b32bd81319ef5863b73078bed50f46a4f7975f50"
+ integrity sha1-syvYExnvWGO3MHi+1Q9GpPeXX1A=
+ dependencies:
+ filenamify "^1.0.0"
+ humanize-url "^1.0.0"
+
+filenamify@^1.0.0:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/filenamify/-/filenamify-1.2.1.tgz#a9f2ffd11c503bed300015029272378f1f1365a5"
+ integrity sha1-qfL/0RxQO+0wABUCknI3jx8TZaU=
+ dependencies:
+ filename-reserved-regex "^1.0.0"
+ strip-outer "^1.0.0"
+ trim-repeated "^1.0.0"
+
filenamify@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/filenamify/-/filenamify-2.1.0.tgz#88faf495fb1b47abfd612300002a16228c677ee9"
@@ -8927,6 +8954,19 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"
+gh-pages@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/gh-pages/-/gh-pages-3.1.0.tgz#ec3ed0f6a6e3fc3d888758fa018f08191c96bd55"
+ integrity sha512-3b1rly9kuf3/dXsT8+ZxP0UhNLOo1CItj+3e31yUVcaph/yDsJ9RzD7JOw5o5zpBTJVQLlJAASNkUfepi9fe2w==
+ dependencies:
+ async "^2.6.1"
+ commander "^2.18.0"
+ email-addresses "^3.0.1"
+ filenamify-url "^1.0.0"
+ find-cache-dir "^3.3.1"
+ fs-extra "^8.1.0"
+ globby "^6.1.0"
+
gh-release-fetch@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/gh-release-fetch/-/gh-release-fetch-1.1.0.tgz#479095e53fbcd470b6c47175ef11e47b5f5f1253"
@@ -9662,6 +9702,14 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==
+humanize-url@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/humanize-url/-/humanize-url-1.0.1.tgz#f4ab99e0d288174ca4e1e50407c55fbae464efff"
+ integrity sha1-9KuZ4NKIF0yk4eUEB8VfuuRk7/8=
+ dependencies:
+ normalize-url "^1.0.0"
+ strip-url-auth "^1.0.0"
+
hyperlinker@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/hyperlinker/-/hyperlinker-1.0.0.tgz#23dc9e38a206b208ee49bc2d6c8ef47027df0c0e"
@@ -12688,7 +12736,7 @@ normalize-range@^0.1.2:
resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942"
integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=
-normalize-url@1.9.1:
+normalize-url@1.9.1, normalize-url@^1.0.0:
version "1.9.1"
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c"
integrity sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=
@@ -16563,6 +16611,11 @@ strip-outer@^1.0.0:
dependencies:
escape-string-regexp "^1.0.2"
+strip-url-auth@^1.0.0:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/strip-url-auth/-/strip-url-auth-1.0.1.tgz#22b0fa3a41385b33be3f331551bbb837fa0cd7ae"
+ integrity sha1-IrD6OkE4WzO+PzMVUbu4N/oM164=
+
sturdy-websocket@^0.1.12:
version "0.1.12"
resolved "https://registry.yarnpkg.com/sturdy-websocket/-/sturdy-websocket-0.1.12.tgz#84bb779f948b585a695f76961dc7d1c4a5e87629"