Skip to content

Commit

Permalink
Merge pull request #1397 from decent-dao/bug/#1396-nested-anchor-tags
Browse files Browse the repository at this point in the history
Fix Nested Anchor Tags
  • Loading branch information
adamgall authored Mar 4, 2024
2 parents 2cd70e5 + 3bc074c commit 78cf343
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions src/components/Proposals/ProposalActions/ProposalAction.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { Button, Flex, Text } from '@chakra-ui/react';
import Link from 'next/link';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { BACKGROUND_SEMI_TRANSPARENT } from '../../../constants/common';
import { DAO_ROUTES } from '../../../constants/routes';
import useSnapshotProposal from '../../../hooks/DAO/loaders/snapshot/useSnapshotProposal';
import { useFractal } from '../../../providers/App/AppProvider';
import { ExtendedSnapshotProposal, FractalProposal, FractalProposalState } from '../../../types';
Expand Down Expand Up @@ -52,7 +50,6 @@ export function ProposalAction({
onCastSnapshotVote?: () => Promise<void>;
}) {
const {
node: { daoAddress },
readOnly: { user, dao },
} = useFractal();
const { t } = useTranslation();
Expand Down Expand Up @@ -102,15 +99,7 @@ export function ProposalAction({

if (!showActionButton) {
if (!expandedView) {
return (
<Button
as={Link}
href={DAO_ROUTES.proposal.relative(daoAddress, proposal.proposalId)}
variant="secondary"
>
{t('details')}
</Button>
);
return <Button variant="secondary">{t('details')}</Button>;
}
// This means that Proposal in state where there's no action to perform
return null;
Expand Down Expand Up @@ -139,17 +128,5 @@ export function ProposalAction({
);
}

return (
<Link
href={DAO_ROUTES.proposal.relative(daoAddress, proposal.proposalId)}
passHref
>
<Button
as="a"
variant={showActionButton && canVote ? 'primary' : 'secondary'}
>
{label}
</Button>
</Link>
);
return <Button variant={showActionButton && canVote ? 'primary' : 'secondary'}>{label}</Button>;
}

0 comments on commit 78cf343

Please sign in to comment.