From f670cc23f206a9d3fe45b6ae0488fb1f221d031c Mon Sep 17 00:00:00 2001 From: Peer Richelsen Date: Thu, 30 Dec 2021 14:36:27 +0100 Subject: [PATCH] added web3 wrapper, needs connection to user_settings db --- pages/event-types/[type].tsx | 40 +++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/pages/event-types/[type].tsx b/pages/event-types/[type].tsx index b88385b94f..5277dccd55 100644 --- a/pages/event-types/[type].tsx +++ b/pages/event-types/[type].tsx @@ -60,6 +60,10 @@ import * as RadioArea from "@components/ui/form/radio-area"; dayjs.extend(utc); dayjs.extend(timezone); +// TODO @danfesi we need to get this boolean from user_settings +// we should also disable the other API calls for web3 if it's disabled +const web3App = true; + interface Token { name?: string; address: string; @@ -163,6 +167,8 @@ const EventTypePage = (props: inferSSRProps) => { useEffect(() => { const fetchTokens = async () => { // Get a list of most popular ERC20s and ERC777s, combine them into a single list, set as tokensList + + // TODO @danfesi we should also disable the API calls for web3 if it's disabled try { const erc20sList: Array = ( await axios.get(`https://api.bloxy.info/token/list?key=${process.env.BLOXY_API_KEY}`) @@ -773,24 +779,26 @@ const EventTypePage = (props: inferSSRProps) => { -
-
- -
-
-
- + {web3App && ( +
+
+ +
+
+
+ +
-
+ )}