From 48405381da2688b0a2f2af80a1596d4562fcbbba Mon Sep 17 00:00:00 2001 From: Felipe Novaes Rocha Date: Fri, 15 Apr 2022 10:10:50 -0300 Subject: [PATCH] fix: create button in dashboard and footer fixed. --- packages/react-app/src/components/dashboard.tsx | 5 ++++- packages/react-app/src/components/footer.tsx | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/react-app/src/components/dashboard.tsx b/packages/react-app/src/components/dashboard.tsx index 4cc99330..5222228a 100644 --- a/packages/react-app/src/components/dashboard.tsx +++ b/packages/react-app/src/components/dashboard.tsx @@ -1,6 +1,7 @@ import { useTheme, textStyle } from '@1hive/1hive-ui'; import { useEffect, useState } from 'react'; import { ENUM_QUEST_VIEW_MODE } from 'src/constants'; +import { useWallet } from 'src/contexts/wallet.context'; import { DashboardModel } from 'src/models/dashboard.model'; import { getDashboardInfo } from 'src/services/quest.service'; import { GUpx } from 'src/utils/style.util'; @@ -39,6 +40,8 @@ const LabelStyled = styled.div` export default function Dashboard() { const theme = useTheme(); const [dashboardModel, setDashboardModel] = useState(); + const { walletAddress } = useWallet(); + useEffect(() => { let isSubscribed = true; getDashboardInfo().then((innerDashboardModel) => { @@ -69,7 +72,7 @@ export default function Dashboard() { {dashboardModel?.questCount} - + {walletAddress && } diff --git a/packages/react-app/src/components/footer.tsx b/packages/react-app/src/components/footer.tsx index 6436994c..537c2a56 100644 --- a/packages/react-app/src/components/footer.tsx +++ b/packages/react-app/src/components/footer.tsx @@ -5,6 +5,7 @@ import styled from 'styled-components'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faDiscord, faTwitter } from '@fortawesome/free-brands-svg-icons'; import { LogoTitle } from 'src/assets/logo-title'; +import { useWallet } from 'src/contexts/wallet.context'; import QuestModal from './modals/quest-modal'; // #region StyledComponent @@ -82,6 +83,8 @@ export default function footer() { const theme = useTheme(); const year = new Date().getFullYear(); + const { walletAddress } = useWallet(); + return ( @@ -104,7 +107,9 @@ export default function footer() { Quest List - + {walletAddress && ( + + )} Community