Skip to content

Commit d2cca78

Browse files
committed
feat: Commit: rename allocation button and update proposal page chart
1 parent 14e3159 commit d2cca78

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

apps/web/app/(app)/gardens/[chain]/[garden]/[community]/[poolId]/[proposalId]/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ export default function Page({
278278
proposalNumber={Number(proposalIdNumber)}
279279
timeToPass={Number(timeToPass)}
280280
onReadyToExecute={triggerConvictionRefetch}
281+
defaultChartMaxValue
281282
/>
282283
</>
283284
}

apps/web/components/Charts/ConvictionBarChart.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type ConvictionBarChartProps = {
1919
proposalNumber: number;
2020
compact?: boolean;
2121
timeToPass?: number;
22+
defaultChartMaxValue?: boolean;
2223
onReadyToExecute?: () => void;
2324
};
2425

@@ -31,6 +32,7 @@ export const ConvictionBarChart = ({
3132
compact,
3233
timeToPass,
3334
onReadyToExecute,
35+
defaultChartMaxValue = false,
3436
}: ConvictionBarChartProps) => {
3537
const supportNeeded = (thresholdPct - proposalSupportPct).toFixed(2);
3638
const scenarioMappings: Record<string, ScenarioMapping> = {
@@ -181,7 +183,7 @@ export const ConvictionBarChart = ({
181183
disabled: true,
182184
};
183185

184-
const borderRadius = [50, 0, 0, 50];
186+
const borderRadius = defaultChartMaxValue ? [50, 50] : [50, 0, 0, 50];
185187

186188
const markLine: MarkLineComponentOption = {
187189
symbol: "none",
@@ -213,6 +215,12 @@ export const ConvictionBarChart = ({
213215
},
214216
z: 50,
215217
};
218+
219+
const chartMaxValue =
220+
defaultChartMaxValue ?
221+
Math.max(currentConvictionPct, proposalSupportPct, thresholdPct)
222+
: 100;
223+
216224
const option: EChartsOption = {
217225
emphasis: emphasis,
218226
yAxis: {
@@ -228,12 +236,12 @@ export const ConvictionBarChart = ({
228236
axisLabel: {
229237
show: false,
230238
formatter: "{value}%",
231-
fontSize: 10,
239+
fontSize: 8,
232240
},
233241
axisLine: {
234242
show: false,
235243
},
236-
max: 100,
244+
max: chartMaxValue,
237245
},
238246
tooltip: {
239247
trigger: "axis",
@@ -273,7 +281,7 @@ export const ConvictionBarChart = ({
273281
show: !compact,
274282
position: "insideRight",
275283
color: "#191919",
276-
fontSize: 10,
284+
fontSize: 8,
277285
formatter: "{@score} %",
278286
},
279287
z:
@@ -294,7 +302,7 @@ export const ConvictionBarChart = ({
294302
show: !compact,
295303
position: "insideRight",
296304
color: "#FFFFFF",
297-
fontSize: 10,
305+
fontSize: 8,
298306
formatter: "{@score} %",
299307
width: 0,
300308
},

apps/web/components/Proposals.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ export function Proposals({
621621
}
622622
tooltip="Make changes in proposals support first"
623623
>
624-
Submit allocation
624+
Submit your support!
625625
</Button>
626626
</div>
627627
: <div>

0 commit comments

Comments
 (0)