Skip to content

Commit

Permalink
Pimpup no claim
Browse files Browse the repository at this point in the history
  • Loading branch information
Corantin committed Jun 17, 2022
1 parent 72f87b5 commit 9a149e3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions packages/react-app/src/components/claim-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { Fragment, useEffect, useMemo, useState } from 'react';
import { useTransactionContext } from 'src/contexts/transaction.context';
import { useIsMountedRef } from 'src/hooks/use-mounted.hook';
import { noop } from 'lodash';
import { ThemeInterface } from 'src/styles/theme';
import { useThemeContext } from 'src/contexts/theme.context';
import { HelpTooltip } from './field-input/help-tooltip';
import * as QuestService from '../services/quest.service';
import Claim from './claim';
Expand Down Expand Up @@ -43,6 +45,20 @@ const EvidenceWrapperStyled = styled.div`
padding: ${GUpx(2)};
`;

const NoClaimBoxStyled = styled.div<{ theme: ThemeInterface }>`
background: ${({ theme }: any) => theme.surfaceUnder} !important;
padding: ${GUpx(2)};
border-radius: 8px;
width: 95%;
margin-left: ${GUpx(2)};
margin-top: ${GUpx(2)};
box-shadow: 10px 10px 15px 5px #00000029;
display: flex;
align-items: center;
justify-content: center;
height: 100px;
`;

// #endregion

type Props = {
Expand All @@ -62,6 +78,7 @@ export default function ClaimList({
const [loadingClaim, setLoadingClaim] = useState(true);
const { transaction } = useTransactionContext();
const isMountedRef = useIsMountedRef();
const { currentTheme } = useThemeContext();

const skeletonClaim = useMemo(() => {
const fakeClaim = {} as ClaimModel;
Expand Down Expand Up @@ -140,7 +157,6 @@ export default function ClaimList({
<HelpTooltip tooltip="A claim includes the proof of the quest's completion." />
</ClaimHeaderStyled>
{claims?.length || loadingClaim ? (
// <Accordion items={accordionItems} className="accordion-fit-content" />
<ClaimsWrapperStyled>
{loadingClaim && skeletonClaim}
{claims.map((claim) => (
Expand Down Expand Up @@ -182,7 +198,7 @@ export default function ClaimList({
</ClaimsWrapperStyled>
) : (
<ClaimsWrapperStyled>
<i>No claims</i>
<NoClaimBoxStyled theme={currentTheme}>No claims</NoClaimBoxStyled>
</ClaimsWrapperStyled>
)}
</WrapperStyled>
Expand Down

0 comments on commit 9a149e3

Please sign in to comment.