Skip to content

Commit 7c285a6

Browse files
authored
Merge pull request #241 from CommonsBuild/develop
ABC Updates
2 parents eeab3f4 + fc4d62e commit 7c285a6

26 files changed

+365
-401
lines changed

public/icons/arrow_in.svg

Lines changed: 4 additions & 0 deletions
Loading

public/icons/arrow_out.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/InfoBox.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const textColors = {
1111
type TextColor = 'neon' | 'white';
1212
interface InfoBoxProps {
1313
color?: TextColor;
14-
label: string;
14+
label: string | React.ReactNode;
1515
link?: string;
1616
tooltipText?: string | React.ReactNode;
1717
}
@@ -23,12 +23,12 @@ function InfoBox({ color = 'white', label, link, tooltipText }: InfoBoxProps) {
2323
<Tooltip isHovered={questionIsHovered} text={tooltipText}>
2424
<div
2525
ref={questionRef}
26-
className="grid grid-flow-col gap-2 justify-between items-center p-3 bg-black-200"
26+
className="grid grid-flow-col gap-2 justify-between items-center px-4 py-2 bg-black-200"
2727
>
2828
<a href={link} target="_blank" rel="noreferrer">
2929
<span
3030
className={classnames(
31-
'font-bj font-bold text-xs cursor-pointer',
31+
'font-bj font-bold text-sm cursor-pointer flex',
3232
textColors[color]
3333
)}
3434
>

src/components/SubmitAnalysis.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function SubmitAnalysis({ params, submitParams, submitProposal }) {
7474
className="font-bj text-2xl text-neon-light p-6"
7575
id="tokenFreezeThaw"
7676
>
77-
Token Freeze & Token Thaw
77+
Token Freeze &amp; Token Thaw
7878
</h3>
7979
<TokenFreezeThawChart
8080
price={chart.tokensReleased}
@@ -99,7 +99,7 @@ function SubmitAnalysis({ params, submitParams, submitProposal }) {
9999
<MilestoneTable data={milestoneTable} />
100100
</div>
101101
<div className="mt-12">
102-
<ABCTable table={{ ...ABCTableData }} showStepZero={false} />
102+
<ABCTable table={{ ...ABCTableData }} />
103103
</div>
104104
</AnalysisContainer>
105105
<AnalysisContainer onVisible={() => setInFocus(3)}>

src/components/SubmitSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ const SubmitSummary = ({
302302
)}
303303
<SummaryContainer
304304
inputList={freezeThawInputs}
305-
title="token freeze & token thaw"
305+
title="token freeze &amp; token thaw"
306306
onChange={handleChange}
307307
textAreaName="tokenFreezeStrategy"
308308
textAreaValue={params.tokenFreezeStrategy}

src/components/btns/RadioButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function RadioButton({
1616
value,
1717
}: RadioButtonProps) {
1818
return (
19-
<p className="mx-4">
19+
<p className="mx-2">
2020
<input
2121
id={id}
2222
type="radio"

src/components/charts/ConvictionGrowth.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2-
import Image from 'next/image';
32
import { Line } from 'react-chartjs-2';
43
import ChartAxisLabel from './ChartAxisLabel';
4+
import ChartGrid from '../ChartGrid';
55

66
interface ConvictionGrowthProps {
77
convictionPercentage: number[];
@@ -85,17 +85,23 @@ function ConvictionGrowthChart({
8585
<div className="w-20 h-0 text-right relative -top-12 -left-2">
8686
<ChartAxisLabel label="% of maximum conviction" />
8787
</div>
88-
<div className="flex justify-center py-2">
88+
<ChartGrid
89+
id="q"
90+
chart={<Line data={data} options={options} />}
91+
xAxisLabel={<ChartAxisLabel label="days" />}
92+
yAxisLabel={<></>}
93+
/>
94+
{/* <div className="flex justify-center py-2">
8995
<div className="w-full">
90-
<Line data={data} options={options} />
9196
<div className="relative h-3/5 abc-chart">
9297
<Image layout="fill" src="/chart_bg.png" />
9398
</div>
99+
<Line data={data} options={options} />
94100
</div>
95-
</div>
96-
<div className="w-24 h-0 ml-auto text-right relative bottom-2">
101+
</div> */}
102+
{/* <div className="w-24 h-0 ml-auto text-right relative bottom-2">
97103
<ChartAxisLabel label="days" />
98-
</div>
104+
</div> */}
99105
</>
100106
);
101107
}

src/components/charts/TokenFreezeThaw.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const TokenFreezeThawChart = ({
9999
}
100100
rotate
101101
tooltipPosition="left"
102-
tooltipText="The price floor is the minimum possible price of the token. This is a result of tokens being frozen and is affected by the paramaters Token Freeze & Token Thaw."
102+
tooltipText="The price floor is the minimum possible price of the token. This is a result of tokens being frozen and is affected by the parameters Token Freeze &amp; Token Thaw."
103103
/>
104104
}
105105
/>

src/components/modals/ABCAddStep.tsx

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,24 @@ function ABCAddStepDialog({
3434
};
3535

3636
return (
37-
<Modal handleClose={handleClose as () => void} isOpen={isOpen} transparent>
37+
<Modal
38+
handleClose={handleClose as () => void}
39+
isOpen={isOpen}
40+
transparent
41+
customButton={
42+
<button
43+
className="h-14 px-6 mx-auto bg-neon outline-none hover:bg-neon-light-600 disabled:opacity-50 disabled:bg-gray-400 disabled:text-gray-300 w-full"
44+
onClick={(e) => {
45+
onClick([Number(stepData.value), stepData.type], 'stepList');
46+
handleClose(e);
47+
}}
48+
>
49+
<span className="font-bj font-bold text-lg uppercase cursor-pointer">
50+
simulate a transaction
51+
</span>
52+
</button>
53+
}
54+
>
3855
<div className="bg-black">
3956
<div className="bg-black-200 px-8 py-6">
4057
<span className="block font-bj font-bold text-xs text-neon-light uppercase pb-2">
@@ -83,17 +100,6 @@ function ABCAddStepDialog({
83100
</span>
84101
</div>
85102
</div>
86-
<a
87-
className="flex justify-center border border-neon my-3"
88-
onClick={(e) => {
89-
onClick([Number(stepData.value), stepData.type], 'stepList');
90-
handleClose(e);
91-
}}
92-
>
93-
<span className="font-bj font-bold text-xs text-neon uppercase p-2 py-3">
94-
add a step
95-
</span>
96-
</a>
97103
</div>
98104
</div>
99105
</Modal>

src/components/modals/ABCScenario.tsx

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,16 @@ function ABCScenarioDialog({ handleClose, isOpen }: ABCScenarioDialogProps) {
1313
title="How to use the ABC Simulator"
1414
>
1515
<p className="font-inter text-lg text-neon-light text-center p-4">
16-
Use the ABC simulator to see how your configurations react to simulated
17-
market environments. Get started by doing the following:
18-
<ul className="list-inside list-disc font-inter">
19-
<li className="py-5">
20-
<b>Choose a Market Scenario,</b> either <i>Bullish</i> or
21-
<i>Bearish</i>. This will modify the 3 initial steps implemented to
22-
begin your economy’s story.
23-
</li>
24-
<li className="py-5">
25-
<b>Select a Reserve Balance.</b> This defines where your steps begin
26-
and the range of your X-axis. Clicking LAUNCH will use the amount of
27-
Hatch funds raised with your Commons Tribute setting.
28-
</li>
29-
<li className="py-5">
30-
<b>Add a Step,</b> to place a buy or sell transaction on your ABC.
31-
This will create a new step on your curve. Take note of the 3 steps
32-
already generated by your Market Scenario.
33-
</li>
34-
</ul>
16+
Watch the graph and the table below the graph to see how your
17+
configuration reacts to transactions. Note that Transaction 0 is the
18+
initial buy that mints tokens for the Commons itself, and the following
19+
3 transactions are generated automatically.
20+
</p>
21+
<p className="font-inter text-lg text-neon-light text-center p-4">
22+
Click the &quot;Simulate a Transaction&quot; button, to place a buy or
23+
sell transaction on your ABC configuration. This will add a new
24+
transaction on the table and the graph. Take note that you can use large
25+
transactions to explore the full range of the ABC.
3526
</p>
3627
</Modal>
3728
);

0 commit comments

Comments
 (0)