From d3234bb703cd59b23bde45f96e0e595bb0aaab58 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Fri, 7 Oct 2022 16:51:49 +0200 Subject: [PATCH] Random chad on render --- src/pages/grafana.js | 11 +++++++++-- src/pages/home.js | 10 +++++++++- src/pages/livepeer.js | 9 ++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/pages/grafana.js b/src/pages/grafana.js index f9c9183..d2ae2e5 100644 --- a/src/pages/grafana.js +++ b/src/pages/grafana.js @@ -11,10 +11,17 @@ import Orchestrator from "../components/orchestratorViewer"; const Grafana = (obj) => { const livepeer = useSelector((state) => state.livepeerstate); const [redirectToHome, setRedirectToHome] = useState(false); + const [thisChad, setChad] = useState(""); + if (redirectToHome) { return ; } + if (thisChad == ""){ + const randomChad = performance.now(); + const chadSource = "https://nframe.nl/avatar.png?" + randomChad; + setChad(chadSource); + } return (
@@ -37,11 +44,11 @@ const Grafana = (obj) => { setRedirectToHome(true); }}>
- +

Livepeer Orchestrator

- +
diff --git a/src/pages/home.js b/src/pages/home.js index 255dcf4..8de555a 100644 --- a/src/pages/home.js +++ b/src/pages/home.js @@ -16,6 +16,8 @@ const Home = (obj) => { const [redirectToLPT, setRedirectToLPT] = useState(false); const [redirectToStats, setRedirectToStats] = useState(false); const [redirectToGraphs, setRedirectToGraphs] = useState(false); + const [thisChad, setChad] = useState(""); + if (redirectToGrafana) { return ; } @@ -35,6 +37,12 @@ const Home = (obj) => { totalVisitorCount = userstate.visitorStats.totalVisitorCount; } + if (thisChad == ""){ + const randomChad = performance.now(); + const chadSource = "https://nframe.nl/avatar.png?" + randomChad; + setChad(chadSource); + } + return (
@@ -51,7 +59,7 @@ const Home = (obj) => { setRedirectToGrafana(true); }}>
- +

Orchestrator

diff --git a/src/pages/livepeer.js b/src/pages/livepeer.js index 85eb9fd..29e4893 100644 --- a/src/pages/livepeer.js +++ b/src/pages/livepeer.js @@ -22,6 +22,7 @@ const Livepeer = (obj) => { const [showFilter, setShowFilter] = useState(false); const [opened, setOpened] = useState(false); const [showSidebar, setShowSidebar] = useState(true); + const [thisChad, setChad] = useState(""); console.log("Rendering Livepeer"); useEffect(() => { @@ -35,6 +36,7 @@ const Livepeer = (obj) => { if (redirectToHome) { return ; } + let thisOrchObj; let headerString; @@ -45,6 +47,11 @@ const Livepeer = (obj) => { headerString = "Livepeer Orchestrator Explorer"; } + if (thisChad == ""){ + const randomChad = performance.now(); + const chadSource = "https://nframe.nl/avatar.png?" + randomChad; + setChad(chadSource); + } return (
@@ -54,7 +61,7 @@ const Livepeer = (obj) => { setRedirectToHome(true); }}>
- +

🏠