Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: create button in dashboard and footer fixed. #232

Merged
merged 1 commit into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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