highlight governance proposals
This commit is contained in:
parent
e26caef368
commit
8a9b74fd89
@ -1,5 +1,7 @@
|
|||||||
import { gql, useQuery } from "@apollo/client";
|
import { gql, useQuery } from '@apollo/client';
|
||||||
import { ProposalsQuery } from "./__generated__/ProposalsQuery";
|
import React from 'react';
|
||||||
|
import { SyntaxHighlighter } from '../../components/syntax-highlighter';
|
||||||
|
import { ProposalsQuery } from './__generated__/ProposalsQuery';
|
||||||
|
|
||||||
const PROPOSAL_QUERY = gql`
|
const PROPOSAL_QUERY = gql`
|
||||||
query ProposalsQuery {
|
query ProposalsQuery {
|
||||||
@ -80,10 +82,18 @@ const PROPOSAL_QUERY = gql`
|
|||||||
|
|
||||||
const Governance = () => {
|
const Governance = () => {
|
||||||
const { data } = useQuery<ProposalsQuery>(PROPOSAL_QUERY);
|
const { data } = useQuery<ProposalsQuery>(PROPOSAL_QUERY);
|
||||||
|
|
||||||
|
if (!data || !data.proposals) return null;
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<h1>Governance</h1>
|
<h1>Governance</h1>
|
||||||
<pre>{JSON.stringify(data, null, " ")}</pre>
|
{data.proposals.map((p) => (
|
||||||
|
<React.Fragment key={p.id}>
|
||||||
|
{/* TODO get proposal name generator from console */}
|
||||||
|
<h2>{p.id}</h2>
|
||||||
|
<SyntaxHighlighter data={p} />
|
||||||
|
</React.Fragment>
|
||||||
|
))}
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user