Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
0xStrobe committed Dec 21, 2022
1 parent 53b0328 commit a5ac65c
Show file tree
Hide file tree
Showing 12 changed files with 1,648 additions and 2,106 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
sitemap.xml.js
.next
out
public
149 changes: 74 additions & 75 deletions LICENCE.md

Large diffs are not rendered by default.

24 changes: 5 additions & 19 deletions components/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ export default function Layout({ children }) {
<div className="p-5 sticky top-0 bottom-0 m-auto flex flex-col items-center gap-8 justify-center h-screen max-w-[480px] mx-auto">
<figure className="lg:mr-auto">
<Logo />
<figcaption className="font-bold text-2xl">
{t("help-info")}
</figcaption>
<figcaption className="font-bold text-2xl">{t("help-info")}</figcaption>
</figure>

<h1 className="font-medium text-base">{t("description")}</h1>
Expand All @@ -30,9 +28,7 @@ export default function Layout({ children }) {
target="_blank"
rel="noopener noreferrer"
>
<span className="text-base font-medium">
{t("add-your-network")}
</span>
<span className="text-base font-medium">{t("add-your-network")}</span>
<svg
xmlns="http://www.w3.org/2000/svg"
fill="none"
Expand All @@ -41,11 +37,7 @@ export default function Layout({ children }) {
stroke="currentColor"
className="w-[22px] h-[22px]"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M12 4.5v15m7.5-7.5h-15"
/>
<path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
</svg>
</a>

Expand All @@ -64,11 +56,7 @@ export default function Layout({ children }) {
stroke="currentColor"
className="w-[22px] h-[22px]"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M12 4.5v15m7.5-7.5h-15"
/>
<path strokeLinecap="round" strokeLinejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
</svg>
</a>
</div>
Expand All @@ -85,9 +73,7 @@ export default function Layout({ children }) {
d="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z"
/>
</svg>
<span className="text-base font-medium">
{t("view-source-code")}
</span>
<span className="text-base font-medium">{t("view-source-code")}</span>
</a>
</div>
</div>
Expand Down
66 changes: 12 additions & 54 deletions components/RPCList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,15 @@ export default function RPCList({ chain }) {
let trust = "transparent";
let disableConnect = false;

if (
!height ||
!latency ||
topRpc.height - height > 3 ||
topRpc.latency - latency > 5000
) {
if (!height || !latency || topRpc.height - height > 3 || topRpc.latency - latency > 5000) {
trust = "red";
} else if (
topRpc.height - height < 2 &&
topRpc.latency - latency > -600
) {
} else if (topRpc.height - height < 2 && topRpc.latency - latency > -600) {
trust = "green";
} else {
trust = "orange";
}

if (url.includes("wss://") || url.includes("API_KEY"))
disableConnect = true;
if (url.includes("wss://") || url.includes("API_KEY")) disableConnect = true;

const lat = latency ? (latency / 1000).toFixed(3) + "s" : null;

Expand Down Expand Up @@ -110,24 +101,14 @@ export default function RPCList({ chain }) {
{sortChains ? (
<span>
<span className="sr-only">Pause</span>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
className="w-4 h-4"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="w-4 h-4">
<path d="M5.75 3a.75.75 0 00-.75.75v12.5c0 .414.336.75.75.75h1.5a.75.75 0 00.75-.75V3.75A.75.75 0 007.25 3h-1.5zM12.75 3a.75.75 0 00-.75.75v12.5c0 .414.336.75.75.75h1.5a.75.75 0 00.75-.75V3.75a.75.75 0 00-.75-.75h-1.5z" />
</svg>
</span>
) : (
<span>
<span className="sr-only">Resume</span>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
className="w-4 h-4"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="w-4 h-4">
<path d="M6.3 2.841A1.5 1.5 0 004 4.11V15.89a1.5 1.5 0 002.3 1.269l9.344-5.89a1.5 1.5 0 000-2.538L6.3 2.84z" />
</svg>
</span>
Expand Down Expand Up @@ -163,9 +144,7 @@ export default function RPCList({ chain }) {
}

const Shimmer = () => {
return (
<div className="rounded h-5 w-full min-w-[40px] animate-pulse bg-[#EAEAEA]"></div>
);
return <div className="rounded h-5 w-full min-w-[40px] animate-pulse bg-[#EAEAEA]"></div>;
};

function PrivacyIcon({ tracking }) {
Expand Down Expand Up @@ -208,12 +187,8 @@ const Row = ({ values, chain, isEthMainnet, privacy }) => {
<td className="border px-3 text-sm py-1 max-w-[40ch] overflow-hidden whitespace-nowrap text-ellipsis">
{isLoading ? <Shimmer /> : data?.url}
</td>
<td className="border text-center px-3 text-sm py-1">
{isLoading ? <Shimmer /> : data?.height}
</td>
<td className="border text-center px-3 text-sm py-1">
{isLoading ? <Shimmer /> : data?.latency}
</td>
<td className="border text-center px-3 text-sm py-1">{isLoading ? <Shimmer /> : data?.height}</td>
<td className="border text-center px-3 text-sm py-1">{isLoading ? <Shimmer /> : data?.latency}</td>
<td className="border px-3 text-sm py-1">
{isLoading ? (
<Shimmer />
Expand Down Expand Up @@ -243,9 +218,7 @@ const Row = ({ values, chain, isEthMainnet, privacy }) => {
!data.disableConnect && (
<button
className="px-2 py-[2px] -my-[2px] text-center text-sm hover:bg-[#EAEAEA] rounded-[50px]"
onClick={() =>
addToNetwork({ address, chain, rpc: data?.url })
}
onClick={() => addToNetwork({ address, chain, rpc: data?.url })}
>
{t(renderProviderText(account))}
</button>
Expand All @@ -270,12 +243,7 @@ const CopyUrl = ({ url = "" }) => {
};

const RedIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="red"
className="w-5 h-5 mx-auto"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="red" className="w-5 h-5 mx-auto">
<path
fillRule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z"
Expand All @@ -285,12 +253,7 @@ const RedIcon = () => (
);

const OrangeIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="orange"
className="w-5 h-5 mx-auto"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="orange" className="w-5 h-5 mx-auto">
<path
fillRule="evenodd"
d="M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z"
Expand All @@ -300,12 +263,7 @@ const OrangeIcon = () => (
);

const GreenIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="green"
className="w-5 h-5 mx-auto"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="green" className="w-5 h-5 mx-auto">
<path
fillRule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"
Expand Down
Loading

0 comments on commit a5ac65c

Please sign in to comment.