-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #528 from terra-money/is-sprint-26
IS-SPRINT-26
- Loading branch information
Showing
48 changed files
with
433 additions
and
319 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,7 @@ yarn-error.log* | |
|
||
.prettierrc | ||
|
||
.vscode | ||
.vscode | ||
|
||
# commit hash used for update detection | ||
public/commit_hash |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,11 @@ | |
"hompage": "https://station.money", | ||
"author": "Terra <[email protected]> (https://station.money)", | ||
"repository": "github:terra-money/station", | ||
"version": "7.3.3", | ||
"version": "7.3.4", | ||
"license": "MIT", | ||
"scripts": { | ||
"start": "react-scripts start", | ||
"build": "react-scripts build", | ||
"start": "echo \"$CF_PAGES_COMMIT_SHA\" > public/commit_hash && react-scripts start", | ||
"build": "echo \"$CF_PAGES_COMMIT_SHA\" > public/commit_hash && react-scripts build", | ||
"test": "react-scripts test", | ||
"prepare": "husky install", | ||
"pre-commit": "lint-staged", | ||
|
@@ -34,13 +34,13 @@ | |
"@terra-money/terra-utils": "^1.0.9", | ||
"@terra-money/terra.js": "^3.1.9", | ||
"@terra-money/terra.proto": "^2.0.0", | ||
"@terra-money/wallet-kit": "^1.0.12", | ||
"@terra-money/wallet-kit": "^1.0.15", | ||
"@tippyjs/react": "^4.2.6", | ||
"axios": "^0.27.2", | ||
"bech32": "^2.0.0", | ||
"bignumber.js": "^9.0.2", | ||
"buffer": "^6.0.3", | ||
"classnames": "^2.3.1", | ||
"classnames": "^2.3.2", | ||
"crypto-js": "^4.1.1", | ||
"date-fns": "^2.28.0", | ||
"i18next": "^21.8.14", | ||
|
@@ -51,17 +51,17 @@ | |
"lottie-react": "^2.3.1", | ||
"numeral": "^2.0.6", | ||
"prettier": "^2.6.2", | ||
"qrcode.react": "^3.0.2", | ||
"qrcode.react": "^3.1.0", | ||
"qs": "^6.11.0", | ||
"ramda": "^0.28.0", | ||
"react": "^17.0.2", | ||
"react": "^18.2.0", | ||
"react-copy-to-clipboard": "^5.1.0", | ||
"react-dom": "^17.0.2", | ||
"react-hook-form": "7.22.5", | ||
"react-dom": "^18.2.0", | ||
"react-hook-form": "^7.29.0", | ||
"react-i18next": "^11.18.1", | ||
"react-modal": "^3.15.1", | ||
"react-query": "^3.39.0", | ||
"react-router-dom": "^6.3.0", | ||
"react-query": "^3.39.3", | ||
"react-router-dom": "^6.15.0", | ||
"recharts": "^2.1.16", | ||
"recoil": "^0.7.2", | ||
"sass": "^1.52.1", | ||
|
@@ -71,18 +71,16 @@ | |
"xss": "1.0.11" | ||
}, | ||
"devDependencies": { | ||
"@emotion/react": "^11.9.0", | ||
"@emotion/styled": "^11.8.1", | ||
"@types/crypto-js": "^4.1.1", | ||
"@types/jest": "^27.5.1", | ||
"@types/node": "^17.0.35", | ||
"@types/numeral": "^2.0.2", | ||
"@types/qrcode.react": "^1.0.2", | ||
"@types/qs": "^6.9.7", | ||
"@types/ramda": "^0.28.13", | ||
"@types/react": "^18.0.9", | ||
"@types/react": "^18.2.21", | ||
"@types/react-copy-to-clipboard": "^5.0.2", | ||
"@types/react-dom": "^18.0.5", | ||
"@types/react-dom": "^18.2.7", | ||
"@types/react-modal": "^3.13.1", | ||
"@types/react-router-dom": "^5.3.3", | ||
"@types/secp256k1": "^4.0.3", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
@import "mixins"; | ||
|
||
.notification { | ||
z-index: 1000; | ||
position: absolute; | ||
bottom: 1.2rem; | ||
left: 50%; | ||
transform: translate(-50%, 0); | ||
background-color: var(--bg); | ||
padding: 0.5rem 1.4rem; | ||
border-radius: 1rem; | ||
//font-size: var(--font-size-small); | ||
white-space: nowrap; | ||
// same shadow as send/receive/buy buttons | ||
box-shadow: inset 0px 1.5px 0px 0px rgb(255 255 255 / 8%), | ||
0px 4px 24px 0px rgb(36 36 40 / 30%); | ||
|
||
button { | ||
color: var(--button-primary-bg); | ||
margin-left: 1rem; | ||
|
||
&:hover { | ||
text-decoration: underline; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { RefetchOptions } from "data/query" | ||
import { useQuery } from "react-query" | ||
import styles from "./UpdateNotification.module.scss" | ||
import { useTranslation } from "react-i18next" | ||
import axios from "axios" | ||
import { useEffect, useRef, useState } from "react" | ||
|
||
const useCommithash = (disabled: boolean) => { | ||
return useQuery( | ||
[], | ||
async () => { | ||
// fetch commit_hash file created at build time | ||
const { data: commit_hash } = await axios.get("/commit_hash") | ||
return commit_hash | ||
}, | ||
{ ...RefetchOptions.DEFAULT, enabled: !disabled } | ||
) | ||
} | ||
|
||
export default function UpdateNotification() { | ||
const old_commit_hash = useRef<string>() | ||
const { t } = useTranslation() | ||
const [showNotification, setShownotification] = useState<boolean>(false) | ||
const { data: commit_hash } = useCommithash(showNotification) | ||
|
||
useEffect(() => { | ||
if (showNotification) return | ||
if (!old_commit_hash.current) old_commit_hash.current = commit_hash | ||
|
||
setShownotification(old_commit_hash.current !== commit_hash) | ||
}, [commit_hash, showNotification]) | ||
|
||
// no update available or request still in progress | ||
// (comment out next line to test) | ||
if (!showNotification) return null | ||
|
||
// update available | ||
return ( | ||
<div className={styles.notification}> | ||
{t("There is a new version available")} | ||
<button onClick={() => window.location.reload()}>{t("Reload")}</button> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.