mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-04-24 03:00:09 -04:00
Added links to/from new quest activity page
This commit is contained in:
committed by
Alec LaLonde
parent
41550cdacd
commit
57b47baaee
@@ -21,6 +21,7 @@ import {
|
||||
} from 'graphql/autogen/types';
|
||||
import moment from 'moment';
|
||||
import React from 'react';
|
||||
import { FaArrowLeft } from 'react-icons/fa';
|
||||
import { getPlayerName } from 'utils/playerHelpers';
|
||||
|
||||
const ConnectedDashboardPage: React.FC<Props> = () => (
|
||||
@@ -42,7 +43,16 @@ export const QuestActivityPage: React.FC<Props> = ({ player }) => {
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<Box w="100%" maxW="80rem">
|
||||
<Box w="100%">
|
||||
<Box mb={4}>
|
||||
<MetaLink href="/quests">
|
||||
<FaArrowLeft
|
||||
fontSize="0.875rem"
|
||||
style={{ display: 'inline-block', marginRight: '0.5rem' }}
|
||||
/>
|
||||
Back to quest explorer
|
||||
</MetaLink>
|
||||
</Box>
|
||||
<HStack justify="space-between" w="100%">
|
||||
<Heading size="xl">Quest Activity</Heading>
|
||||
</HStack>
|
||||
@@ -94,6 +104,7 @@ export const QuestActivityPage: React.FC<Props> = ({ player }) => {
|
||||
</TableContainer>
|
||||
</>
|
||||
)}
|
||||
{createdQuests?.length === 0 && <Box>You have no active quests.</Box>}
|
||||
</Box>
|
||||
</PageContainer>
|
||||
);
|
||||
|
||||
@@ -4,12 +4,14 @@ import {
|
||||
HStack,
|
||||
LoadingState,
|
||||
MetaButton,
|
||||
MetaSecondaryButton,
|
||||
Text,
|
||||
Tooltip,
|
||||
useToast,
|
||||
} from '@metafam/ds';
|
||||
import { Constants } from '@metafam/utils';
|
||||
import { PageContainer } from 'components/Container';
|
||||
import { MetaLink } from 'components/Link';
|
||||
import { QuestFilter } from 'components/Quest/QuestFilter';
|
||||
import { QuestList } from 'components/Quest/QuestList';
|
||||
import { HeadComponent } from 'components/Seo';
|
||||
@@ -67,31 +69,35 @@ const QuestsPage: React.FC<Props> = ({ roleChoices }) => {
|
||||
<Box w="100%" maxW="80rem">
|
||||
<HStack justify="space-between" w="100%">
|
||||
<Heading>Quest Explorer</Heading>
|
||||
<Tooltip
|
||||
label={
|
||||
!canCreateQuest &&
|
||||
`You need to hold at least ${Constants.PSEED_FOR_QUEST} pSEED to create a quest.`
|
||||
}
|
||||
>
|
||||
<MetaButton
|
||||
// disabled={!canCreateQuest} // if disabled, tooltip doesn't show...
|
||||
isLoading={fetchingBalance}
|
||||
onClick={() => {
|
||||
if (!canCreateQuest) {
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: `Insufficient pSEED Balance. Must have ≥ ${Constants.PSEED_FOR_QUEST} pSEED.`,
|
||||
status: 'error',
|
||||
isClosable: true,
|
||||
});
|
||||
} else {
|
||||
router.push('/quest/create');
|
||||
}
|
||||
}}
|
||||
<Box>
|
||||
<Tooltip
|
||||
label={
|
||||
!canCreateQuest &&
|
||||
`You need to hold at least ${Constants.PSEED_FOR_QUEST} pSEED to create a quest.`
|
||||
}
|
||||
>
|
||||
New Quest
|
||||
</MetaButton>
|
||||
</Tooltip>
|
||||
<MetaButton
|
||||
isLoading={fetchingBalance}
|
||||
onClick={() => {
|
||||
if (!canCreateQuest) {
|
||||
toast({
|
||||
title: 'Error',
|
||||
description: `Insufficient pSEED Balance. Must have ≥ ${Constants.PSEED_FOR_QUEST} pSEED.`,
|
||||
status: 'error',
|
||||
isClosable: true,
|
||||
});
|
||||
} else {
|
||||
router.push('/quest/create');
|
||||
}
|
||||
}}
|
||||
>
|
||||
New Quest
|
||||
</MetaButton>
|
||||
</Tooltip>
|
||||
<MetaLink href="/quest/activity" ml={4}>
|
||||
<MetaSecondaryButton>Your Activity</MetaSecondaryButton>
|
||||
</MetaLink>
|
||||
</Box>
|
||||
</HStack>
|
||||
<Box mt={8} w="100%">
|
||||
<QuestFilter
|
||||
|
||||
Reference in New Issue
Block a user