This repository has been archived by the owner on Feb 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ae9132
commit f5d29fd
Showing
12 changed files
with
233 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import * as React from "react"; | ||
import { IconButton, Menu, MenuItem, Tooltip, Button } from "@material-ui/core"; //tslint:disable-line | ||
import { useTranslation } from "react-i18next"; | ||
import { supportedLanguages, reverseSupportedLanguages } from "../../i18n"; | ||
|
||
const LanguageMenu: React.FC = (props) => { | ||
const { t, i18n } = useTranslation(); | ||
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null); | ||
|
||
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => { | ||
setAnchorEl(event.currentTarget); | ||
}; | ||
|
||
const handleMenuItemClick = (lang: string) => { | ||
setAnchorEl(null); | ||
// this forces language change for react + i18n react | ||
i18n.changeLanguage(reverseSupportedLanguages[lang]); | ||
}; | ||
|
||
const handleClose = () => { | ||
setAnchorEl(null); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Tooltip title={t("Change Language")}> | ||
<Button onClick={handleClick}>{supportedLanguages[i18n.language]}</Button> | ||
</Tooltip> | ||
<Menu | ||
id="simple-menu" | ||
anchorEl={anchorEl} | ||
keepMounted | ||
open={Boolean(anchorEl)} | ||
onClose={handleClose} | ||
> | ||
{Object.values(supportedLanguages).map((lang, i) => ( | ||
<MenuItem onClick={(event) => handleMenuItemClick(lang)}>{lang}</MenuItem> | ||
))} | ||
</Menu> | ||
</> | ||
) | ||
}; | ||
|
||
export default LanguageMenu; |
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,2 @@ | ||
import LanguageMenu from "./LanguageMenu"; | ||
export default LanguageMenu; |
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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import moment from "moment"; | ||
|
||
const hexToDate = (hexTimestamp: string) => { | ||
return moment( | ||
new Date(parseInt(hexTimestamp, 16) * 1000).toISOString(), | ||
).format("MMMM Do YYYY, h:mm:ss a"); | ||
return new Date(parseInt(hexTimestamp, 16) * 1000).toISOString(); | ||
}; | ||
|
||
export default hexToDate; |
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import * as React from "react"; | ||
import * as ReactDOM from "react-dom"; | ||
import App from "./App"; | ||
import { I18nextProvider } from "react-i18next"; | ||
import i18n from "i18next"; | ||
import { ReusableProvider } from "reusable"; | ||
import "./i18n"; | ||
|
||
ReactDOM.render( | ||
<ReusableProvider> | ||
<App /> | ||
</ReusableProvider>, | ||
<I18nextProvider i18n={i18n}> | ||
<ReusableProvider> | ||
<App /> | ||
</ReusableProvider> | ||
</I18nextProvider>, | ||
document.getElementById("root") as HTMLElement, | ||
); |
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,61 @@ | ||
export default { | ||
// Moment integration | ||
"Timestamp Date": "{{date, date}}", | ||
// App Bar | ||
"Explorer": "ๆต่งๅจ", | ||
"Enter an Address, Transaction Hash or Block Number": "่พๅ ฅๅฐๅ ไบคๆๅๅธๆๅบๅๅท", | ||
"JSON-RPC API Documentation": "JSON-RPC API ๆๆกฃ", | ||
"Jade Explorer Github": "Jade Explorer Github", | ||
"Toggle Dark Mode": "ๅๆข้ปๆๆจกๅผ", | ||
// Dashboard | ||
"Block Height": "ๅบๅ้ซๅบฆ", | ||
"Chain ID": "Chain ID", | ||
"Syncing": "ๅๆญฅไธญ", | ||
"Gas Price": "Gas ่ดน็จ", | ||
"Network Hash Rate": "็ฎๅ", | ||
"Pending Transactions": "็ญๅพ ไธญ็ไบคๆ", | ||
"Peers": "็ซฏ็น", | ||
"Hash Rate last blocks": "ไธไธชๅบๅ็ฎๅ", | ||
"Hash Rate last blocks_plural": "ๅ{{count}}ไธชๅบๅ็ฎๅ", | ||
"Transaction count last blocks": "ไธไธชๅบๅไบคๆๆฐ้", | ||
"Transaction count last blocks_plural": "ๅ {{count}}ไธชๅบๅไบคๆๆฐ้", | ||
"Gas Used last blocks": "ไธไธชๅบๅGasๆถ่", | ||
"Gas Used last blocks_plural": "ๅ{{count}}ไธชๅบๅGasๆถ่", | ||
"Uncles last blocks": "ไธไธชๅบๅๅๅ", | ||
"Uncles last blocks_plural": "ๅ{{count}}ไธชๅบๅๅๅ", | ||
// block list | ||
"Block Number": "ๅบๅ็ผๅท", | ||
"Hash": "ๅๅธ", | ||
"Timestamp": "ๆถ้ดๆณ", | ||
"Transactions": "ไบคๆ", | ||
// block view | ||
"Number": "ๆฐ้", | ||
"ParentHash": "็ถๅๅธ", | ||
"Miner": "็ฟๅทฅ", | ||
"Nonce": "้ๆบๆฐ", | ||
"Difficulty": "้พๅบฆ", | ||
"Extra Data": "้ขๅคๆฐๆฎ", | ||
"State Root": "็ถๆๆ น", | ||
"Transaction Root": "ไบคๆๆ น", | ||
"Receipts Root": "ๆฅๆถๆ น", | ||
// transaction view | ||
"Block": "ๅบๅ", | ||
"Gas Used": "Gas ๆถ่", | ||
"Cumulative Gas Used": "็ดฏ่ฎกGasๆถ่", | ||
"Value in Ether": "Etherๅผ", | ||
"From": "ไป", | ||
"To": "ๅฐ", | ||
"Contract Address": "ๅ็บฆๅฐๅ", | ||
"Transaction Index": "ไบคๆ็ดขๅผ", | ||
"Receipt Status": "ๆฅๆถ็ถๆ", | ||
"Receipt Logs": "ๆฅๆถๆฅๅฟ", | ||
// address view | ||
"Address": "ๅฐๅ", | ||
"Balance": "ไฝ้ข", | ||
"Code": "ไปฃ็ ", | ||
// configuration menu | ||
"Configuration": "้ ็ฝฎ", | ||
"Back": "่ฟๅ", | ||
"Ethereum RPC": "Ethereum RPC", | ||
"Service Runner RPC": "Service Runner RPC", | ||
}; |
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,61 @@ | ||
export default { | ||
// Moment integration | ||
"Timestamp Date": "{{date, date}}", | ||
// App Bar | ||
"Explorer": "๋ธ๋ผ์ฐ์ ", | ||
"Enter an Address, Transaction Hash or Block Number": "๊ฑฐ๋์ฃผ์ ํด์๊ฐ ํน์ ๋ธ๋ก๋ฒํธ ์ ๋ ฅ", | ||
"JSON-RPC API Documentation": "JSON-RPC API ๋ฌธ์", | ||
"Jade Explorer Github": "Jade Explorer Github", | ||
"Toggle Dark Mode": "๋ธ๋๋ชจ๋ ๋ณ๊ฒฝ", | ||
// Dashboard | ||
"Block Height": "๋ธ๋ก๋์ด", | ||
"Chain ID": "Chain ID", | ||
"Syncing": "๋๊ธฐํ", | ||
"Gas Price": "Gas ๋น์ฉ", | ||
"Network Hash Rate": "ํด์ํ์", | ||
"Pending Transactions": "๋๊ธฐ์ธ ๊ฑฐ๋", | ||
"Peers": "๊ฑฐ์ ", | ||
"Hash Rate last blocks": "์ด์ ๋ธ๋ก ํด์ํ์", | ||
"Hash Rate last blocks_plural": "{{count}}๊ฐ ์ด์ ๋ธ๋ก ํด์ํ์", | ||
"Transaction count last blocks": "์ด์ ๋ธ๋ก ๊ฑฐ๋์๋", | ||
"Transaction count last blocks_plural": "{{count}}๊ฐ ์ด์ ๋ธ๋ก ํด์ํ์", | ||
"Gas Used last blocks": "์ด์ ๋ธ๋ก Gas์๋ชจ", | ||
"Gas Used last blocks_plural": "{{count}}๊ฐ ์ด์ ๋ธ๋ก Gas์๋ชจ", | ||
"Uncles last blocks": "์ด๋ฒ ๋ธ๋ก์ ์ํด๋ธ๋ก", | ||
"Uncles last blocks_plural": "{{count}}๊ฐ ์ด์ ๋ธ๋ก์ ์ํด๋ธ๋ก", | ||
// block list | ||
"Block Number": "๋ธ๋ก๋ฒํธ", | ||
"Hash": "ํด์", | ||
"Timestamp": "ํ์ ์คํฌํ", | ||
"Transactions": "๊ฑฐ๋", | ||
// block view | ||
"Number": "์๋", | ||
"ParentHash": "ParentHash", | ||
"Miner": "๋ง์ด๋", | ||
"Nonce": "๋ชฉํ", | ||
"Difficulty": "๋์ด๋", | ||
"Extra Data": "์ถ๊ฐ ๋ฐ์ดํฐ", | ||
"State Root": "์ฃผ ๋ฃจํธ", | ||
"Transaction Root": "๊ฑฐ๋ ๋ฃจํธ", | ||
"Receipts Root": "์์ ๋ฃจํธ", | ||
// transaction view | ||
"Block": "๋ธ๋ก", | ||
"Gas Used": "Gas ์๋ชจ", | ||
"Cumulative Gas Used": "๋์ Gas์๋ชจ", | ||
"Value in Ether": "Ether๊ฐ", | ||
"From": "๋ถํฐ", | ||
"To": "์ผ๋ก", | ||
"Contract Address": "๊ณ์ฝ์ฃผ์", | ||
"Transaction Index": "๊ฑฐ๋ ์ธ๋ฑ์ค", | ||
"Receipt Status": "์์ ์ํ", | ||
"Receipt Logs": "์์ ์ผ์ง", | ||
// address view | ||
"Address": "์ฃผ์", | ||
"Balance": "์์ก", | ||
"Code": "์ฝ๋", | ||
// configuration menu | ||
"Configuration": "๊ตฌ์ฑ", | ||
"Back": "๋ค๋ก", | ||
"Ethereum RPC": "Ethereum RPC", | ||
"Service Runner RPC": "Service Runner RPC", | ||
}; |