Skip to content

Commit

Permalink
fix: create button in dashboard and footer fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
kamikazebr committed Apr 15, 2022
1 parent e3ed71f commit 4840538
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/react-app/src/components/dashboard.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -39,6 +40,8 @@ const LabelStyled = styled.div`
export default function Dashboard() {
const theme = useTheme();
const [dashboardModel, setDashboardModel] = useState<DashboardModel>();
const { walletAddress } = useWallet();

useEffect(() => {
let isSubscribed = true;
getDashboardInfo().then((innerDashboardModel) => {
Expand Down Expand Up @@ -69,7 +72,7 @@ export default function Dashboard() {
<TextStyled theme={theme}>{dashboardModel?.questCount}</TextStyled>
</FieldInput>
<SpacerStyled>
<QuestModal questMode={ENUM_QUEST_VIEW_MODE.Create} />
{walletAddress && <QuestModal questMode={ENUM_QUEST_VIEW_MODE.Create} />}
</SpacerStyled>
</ChildSpacer>
</BoxStyled>
Expand Down
7 changes: 6 additions & 1 deletion packages/react-app/src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -82,6 +83,8 @@ export default function footer() {
const theme = useTheme();
const year = new Date().getFullYear();

const { walletAddress } = useWallet();

return (
<FooterContainerStyled color={theme.contentSecondary}>
<FooterContainerStyledSide>
Expand All @@ -104,7 +107,9 @@ export default function footer() {
<FooterLinkStyled href="#" external={false}>
Quest List
</FooterLinkStyled>
<QuestModal questMode={ENUM_QUEST_VIEW_MODE.Create} buttonMode="link" />
{walletAddress && (
<QuestModal questMode={ENUM_QUEST_VIEW_MODE.Create} buttonMode="link" />
)}
</FooterColumnStyled>
<FooterColumnStyled>
<FooterTitleStyled>Community</FooterTitleStyled>
Expand Down

0 comments on commit 4840538

Please sign in to comment.