Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Dec 14, 2023
2 parents 887d72d + 317eba7 commit 519d70e
Show file tree
Hide file tree
Showing 40 changed files with 4,105 additions and 125 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ NEXT_PUBLIC_INFURA_IPFS_API_KEY=""
NEXT_PUBLIC_INFURA_IPFS_API_SECRET=""
# site preview links
NEXT_PUBLIC_SITE_URL="https://app.dev.fractalframework.xyz/"
# Shutter Public Key
NEXT_PUBLIC_SHUTTER_EON_PUBKEY=0x0e6493bbb4ee8b19aa9b70367685049ff01dc9382c46aed83f8bc07d2a5ba3e6030bd83b942c1fd3dff5b79bef3b40bf6b666e51e7f0be14ed62daaffad47435265f5c9403b1a801921981f7d8659a9bd91fe92fb1cf9afdb16178a532adfaf51a237103874bb03afafe9cab2118dae1be5f08a0a28bf488c1581e9db4bc23ca
15 changes: 12 additions & 3 deletions app/daos/[daoAddress]/proposals/[proposalId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { AzoriusProposalDetails } from '../../../../../src/components/Proposals/AzoriusDetails';
import { MultisigProposalDetails } from '../../../../../src/components/Proposals/MultisigProposalDetails';
import SnapshotProposalDetails from '../../../../../src/components/Proposals/SnapshotProposalDetails';
import { EmptyBox } from '../../../../../src/components/ui/containers/EmptyBox';
import { InfoBoxLoader } from '../../../../../src/components/ui/loaders/InfoBoxLoader';
import PageHeader from '../../../../../src/components/ui/page/Header/PageHeader';
import ClientOnly from '../../../../../src/components/ui/utils/ClientOnly';
import { DAO_ROUTES } from '../../../../../src/constants/routes';
import useSnapshotProposal from '../../../../../src/hooks/DAO/loaders/snapshot/useSnapshotProposal';
import { useGetMetadata } from '../../../../../src/hooks/DAO/proposal/useGetMetadata';
import { useFractal } from '../../../../../src/providers/App/AppProvider';
import { FractalProposal, AzoriusProposal } from '../../../../../src/types';
import { FractalProposal, AzoriusProposal, SnapshotProposal } from '../../../../../src/types';

export default function ProposalDetailsPage({
params: { proposalId },
Expand All @@ -25,6 +27,7 @@ export default function ProposalDetailsPage({
} = useFractal();

const [proposal, setProposal] = useState<FractalProposal | null>();
const { isSnapshotProposal, snapshotProposal } = useSnapshotProposal(proposal);
const metaData = useGetMetadata(proposal);
const { t } = useTranslation(['proposal', 'navigation', 'breadcrumbs', 'dashboard']);

Expand All @@ -37,14 +40,18 @@ export default function ProposalDetailsPage({
}

const foundProposal = proposals.find(p => {
const currentSnapshotProposal = p as SnapshotProposal;
if (!!currentSnapshotProposal.snapshotProposalId) {
return currentSnapshotProposal.snapshotProposalId === proposalId;
}
return p.proposalId === proposalId;
});
if (!foundProposal) {
setProposal(null);
return;
}
setProposal(foundProposal);
}, [proposals, proposalId]);
}, [proposals, proposalId, isSnapshotProposal]);

return (
<ClientOnly>
Expand All @@ -59,7 +66,7 @@ export default function ProposalDetailsPage({
terminus: t('proposal', {
ns: 'breadcrumbs',
proposalId,
proposalTitle: metaData.title,
proposalTitle: metaData.title || snapshotProposal?.title,
}),
path: '',
},
Expand All @@ -69,6 +76,8 @@ export default function ProposalDetailsPage({
<InfoBoxLoader />
) : proposal === null ? (
<EmptyBox emptyText={t('noProposal')} />
) : isSnapshotProposal ? (
<SnapshotProposalDetails proposal={proposal as SnapshotProposal} />
) : dao?.isAzorius ? (
<AzoriusProposalDetails proposal={azoriusProposal} />
) : (
Expand Down
7 changes: 7 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: undefined,
webpack(config) {
config.resolve.fallback = {
fs: false,
};

return config;
},
images: {
dangerouslyAllowSVG: true,
contentDispositionType: 'attachment',
Expand Down
Loading

0 comments on commit 519d70e

Please sign in to comment.