Skip to content

Commit

Permalink
Merge pull request #455 from 1Hive/hide-completed-proposals
Browse files Browse the repository at this point in the history
Hide completed proposals
  • Loading branch information
Corantin authored Oct 9, 2024
2 parents add794d + 8645469 commit 7c73293
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 118 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ cache/
pkg/subgraph/generated
pkg/**/data
cookies.json
.graphclientrc.yml

lcov.info
# some abi should be ignored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default function Page({
thresholdPct={thresholdPct}
proposalSupportPct={totalSupportPct}
isSignalingType={isSignalingType}
proposalId={Number(proposalIdNumber)}
proposalNumber={Number(proposalIdNumber)}
/>
</>
}
Expand Down
12 changes: 3 additions & 9 deletions apps/web/components/Charts/ConvictionBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type ConvictionBarChartProps = {
thresholdPct: number;
proposalSupportPct: number;
isSignalingType: boolean;
proposalId: number;
proposalNumber: number;
compact?: boolean;
};

Expand All @@ -24,7 +24,7 @@ export const ConvictionBarChart = ({
thresholdPct,
proposalSupportPct,
isSignalingType,
proposalId,
proposalNumber,
compact,
}: ConvictionBarChartProps) => {
const supportNeeded = (thresholdPct - proposalSupportPct).toFixed(2);
Expand Down Expand Up @@ -170,12 +170,6 @@ export const ConvictionBarChart = ({
const supportGtConv = proposalSupportPct > currentConvictionPct;
const convEqSupport = proposalSupportPct === currentConvictionPct;

const maxValue = Math.max(
proposalSupportPct,
currentConvictionPct,
thresholdPct,
);

const emphasis = {
disabled: true,
};
Expand Down Expand Up @@ -215,7 +209,7 @@ export const ConvictionBarChart = ({
const option: EChartsOption = {
emphasis: emphasis,
yAxis: {
data: [`Proposal #${proposalId}`],
data: [`Proposal #${proposalNumber}`],
axisTick: { show: false },

axisLine: {
Expand Down
24 changes: 10 additions & 14 deletions apps/web/components/ProposalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,8 @@ export type ProposalCardProps = {
metadata?: Maybe<Pick<ProposalMetadata, "title">>;
};
strategyConfig: Pick<CVStrategyConfig, "decay" | "proposalType">;
inputData: ProposalInputItem;
inputData?: ProposalInputItem;
stakedFilter: ProposalInputItem;
index: number;
poolToken: FetchTokenResult;
isAllocationView: boolean;
memberActivatedPoints: number;
Expand All @@ -48,15 +47,14 @@ export type ProposalCardProps = {
tokenDecimals: number;
alloInfo: Allo;
tokenData: Parameters<typeof useConvictionRead>[0]["tokenData"];
inputHandler: (i: number, value: number) => void;
inputHandler: (proposalId: string, value: number) => void;
};

export function ProposalCard({
proposalData,
strategyConfig,
inputData,
stakedFilter,
index,
poolToken,
isAllocationView,
memberActivatedPoints,
Expand Down Expand Up @@ -168,7 +166,7 @@ export function ProposalCard({
}
step={memberActivatedPoints / 100}
onChange={(e) =>
inputHandler(index, Number(e.target.value))
inputHandler(proposalData.id, Number(e.target.value))
}
/>
<div className="flex w-full justify-between px-2.5">
Expand All @@ -181,7 +179,7 @@ export function ProposalCard({
</div>
</div>
<div className="mb-2">
{Number(inputValue) > 0 && (
{inputValue > 0 && (
<>
<div className="flex gap-10">
<div className="flex flex-col items-center justify-center">
Expand Down Expand Up @@ -223,7 +221,7 @@ export function ProposalCard({
thresholdPct={isSignalingType ? 0 : thresholdPct}
proposalSupportPct={totalSupportPct}
isSignalingType={isSignalingType}
proposalId={proposalNumber}
proposalNumber={proposalNumber}
/>
</div>
</div>
Expand All @@ -233,15 +231,13 @@ export function ProposalCard({
</div>
</div>
</div>
{
{!isAllocationView && stakedFilter && stakedFilter?.value > 0 && (
<div className="">
{!isAllocationView && stakedFilter && stakedFilter?.value > 0 && (
<p className="flex items-baseline text-xs">
Your support: {poolWeightAllocatedInProposal}%
</p>
)}
<p className="flex items-baseline text-xs">
Your support: {poolWeightAllocatedInProposal}%
</p>
</div>
}
)}
{/* TODO: fetch every member stake */}
{/* {!isAllocationView && <p className="text-sm mt-1">3 Supporters</p>} */}
</>
Expand Down
Loading

0 comments on commit 7c73293

Please sign in to comment.