File tree Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Expand file tree Collapse file tree 4 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 22export REACT_APP_DEPLOYMENT=devnet
33export REACT_APP_KLEROS_CORE_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-devnet
44export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_DEVNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-devnet
5+ export REACT_APP_DEVNET_STATUS_URL=https://kleros-v2-devnet.betteruptime.com/badge
Original file line number Diff line number Diff line change 22export REACT_APP_DEPLOYMENT=testnet
33export REACT_APP_KLEROS_CORE_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-core-testnet-2
44export REACT_APP_DISPUTE_TEMPLATE_ARBGOERLI_SUBGRAPH_TESTNET=https://api.thegraph.com/subgraphs/name/kleros/kleros-v2-dr-testnet-2
5+ export REACT_APP_TESTNET_STATUS_URL=https://kleros-v2.betteruptime.com/badge
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import Telegram from "svgs/socialmedia/telegram.svg";
1212import { IHelp } from ".." ;
1313import Debug from "../Debug" ;
1414import Onboarding from "components/Popup/MiniGuides/Onboarding" ;
15+ import { StatusBadge } from "./StatusBadge" ;
1516
1617const Container = styled . div `
1718 display: flex;
@@ -122,6 +123,7 @@ const Help: React.FC<IHelp> = ({ toggleIsHelpOpen }) => {
122123 < small > { item . text } </ small >
123124 </ ListItem >
124125 ) ) }
126+ < StatusBadge />
125127 < Debug />
126128 </ Container >
127129 { isOnboardingMiniGuidesOpen && < Onboarding toggleMiniGuide = { toggleIsOnboardingMiniGuidesOpen } /> }
Original file line number Diff line number Diff line change 1+ import React , { useMemo } from "react" ;
2+ import styled from "styled-components" ;
3+ import { useToggleTheme } from "hooks/useToggleThemeContext" ;
4+
5+ const Container = styled . div `
6+ padding: 0px 3px;
7+ max-width: 220px;
8+ ` ;
9+
10+ const StyledIframe = styled . iframe `
11+ border: none;
12+ width: 100%;
13+ height: 30px;
14+ background-color: ${ ( { theme } ) => theme . mediumPurple } ;
15+ border-radius: 300px;
16+ ` ;
17+
18+ export const StatusBadge : React . FC = ( ) => {
19+ const [ theme ] = useToggleTheme ( ) ;
20+
21+ const deployment = process . env . REACT_APP_DEPLOYMENT ?? "testnet" ;
22+
23+ let statusUrl : string ;
24+
25+ switch ( deployment ) {
26+ case "devnet" :
27+ statusUrl = process . env . REACT_APP_DEVNET_STATUS_URL ! ;
28+ break ;
29+ case "testnet" :
30+ statusUrl = process . env . REACT_APP_TESTNET_STATUS_URL ! ;
31+ break ;
32+ default :
33+ statusUrl = process . env . REACT_APP_TESTNET_STATUS_URL ! ;
34+ }
35+
36+ //update url on theme toggle
37+ statusUrl = useMemo ( ( ) => ( theme == "light" ? statusUrl + "?theme=light" : statusUrl + "?theme=dark" ) , [ theme ] ) ;
38+
39+ return (
40+ < Container >
41+ < StyledIframe src = { statusUrl } />
42+ </ Container >
43+ ) ;
44+ } ;
You can’t perform that action at this time.
0 commit comments