From 76002ec49e823c1f3608d26302cb0ea4ca232b6e Mon Sep 17 00:00:00 2001 From: OMAXCHAIN <103971478+OMAXCHAIN@users.noreply.github.com> Date: Sat, 21 Jan 2023 20:50:28 +0530 Subject: [PATCH 001/873] added omaxchain rpcs to constants/extraRpcs.js --- constants/extraRpcs.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/constants/extraRpcs.js b/constants/extraRpcs.js index 49313f706b..3c8c60cd37 100644 --- a/constants/extraRpcs.js +++ b/constants/extraRpcs.js @@ -1763,6 +1763,9 @@ export const extraRpcs = { "https://mainnet-rpc4.memescan.io/", ], }, + 311: { + rpcs: ['https://mainapi.omaxray.com/'], + }, 13000: { rpcs: ["https://rpc.ssquad.games"], }, From 6b503c90363902efdba161a5378d1706a935688f Mon Sep 17 00:00:00 2001 From: Halvor Holsten Strand Date: Tue, 31 Jan 2023 19:36:58 +0100 Subject: [PATCH 002/873] Togglable dark mode. --- components/Layout/index.js | 66 ++++++++++++++++++++++++++++++++++--- components/RPCList/index.js | 16 ++++----- components/chain/index.js | 18 +++++----- components/header/index.js | 17 +++++----- pages/_document.js | 11 +++++++ pages/chain/[chain].js | 12 +++---- pages/index.js | 2 +- pages/zh/chain/[chain].js | 12 +++---- tailwind.config.js | 1 + translations/en.json | 3 +- translations/zh.json | 3 +- 11 files changed, 116 insertions(+), 45 deletions(-) diff --git a/components/Layout/index.js b/components/Layout/index.js index a8f7063c55..cec99eb686 100644 --- a/components/Layout/index.js +++ b/components/Layout/index.js @@ -1,11 +1,36 @@ import * as React from "react"; +import { useEffect } from "react"; import Header from "../header"; // import { useTranslations } from "next-intl"; import { notTranslation as useTranslations } from "../../utils"; import Logo from "./Logo"; import { useRouter } from "next/router"; +const toggleTheme = (e) => { + e.preventDefault(); + const element = document.body; + document.getElementById("theme-toggle-dark-icon").classList.toggle("hidden"); + document.getElementById("theme-toggle-light-icon").classList.toggle("hidden"); + const result = element.classList.toggle("dark"); + localStorage.setItem('theme', result ? 'dark' : 'light'); +} + +const initTheme = () => { + const element = document.body; + if(element.classList.contains('dark')) { + document.getElementById("theme-toggle-light-icon").classList.remove("hidden"); + } + else { + document.getElementById("theme-toggle-dark-icon").classList.remove("hidden"); + } +} + + export default function Layout({ children, lang }) { + useEffect(() => { + initTheme(); + }, []); + const t = useTranslations("Common", lang); const router = useRouter(); @@ -16,7 +41,7 @@ export default function Layout({ children, lang }) { return (
-
+
@@ -27,7 +52,7 @@ export default function Layout({ children, lang }) {
-
+
{children} diff --git a/components/RPCList/index.js b/components/RPCList/index.js index 451bb1a5d3..3156eca890 100644 --- a/components/RPCList/index.js +++ b/components/RPCList/index.js @@ -82,7 +82,7 @@ export default function RPCList({ chain, lang }) { const isEthMainnet = chain?.name === "Ethereum Mainnet"; return ( -
+
{isEthMainnet && (

Follow{" "} @@ -98,11 +98,11 @@ export default function RPCList({ chain, lang }) {

)} - +
- @@ -240,7 +240,7 @@ const Row = ({ values, chain, isEthMainnet, privacy, lang, className }) => { ) : ( !data.disableConnect && (
{`${chain.name} RPC URL List`}
+ {isLoading ? : data?.url} {isLoading ? : data?.height}
- - + + - - + @@ -86,7 +86,7 @@ export default function Chain({ chain, buttonOnly, lang }) {
ChainID{t("currency")}ChainID{t("currency")}
{chain.chainId} + {chain.chainId} {chain.nativeCurrency ? chain.nativeCurrency.symbol : "none"}