Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Mana Calculator small improvements #1331

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/components/ManaCalculator/components/BlocksAllowance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ export function BlocksAllowance({
<YAxis
width={100}
label={{ value: 'Blocks', angle: -90, position: 'insideLeft' }}
color='rgb(169, 184, 214)'
unit={unitString}
/>
<CartesianGrid
strokeDasharray='3 3'
stroke='rgb(255, 255, 255, 0.15)'
stroke='rgb(150, 150, 150, 0.3)'
/>
<Tooltip content={chartTooltip('Epoch', 'Blocks', unit)} />
<Area
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export function ManaAccumulation({
/>
<CartesianGrid
strokeDasharray='3 3'
stroke='rgb(255, 255, 255, 0.15)'
stroke='rgb(150, 150, 150, 0.3)'
/>
<Tooltip content={chartTooltip('Epoch', 'Mana', unit)} />
<Area
Expand Down
2 changes: 1 addition & 1 deletion src/components/ManaCalculator/components/ValidatorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function ValidatorCard({
onChange={(e) => handleFCChange(Number(e.target.value), id)}
></input>
<button
className=' button button--remove'
className=' button button--remove mana-calculator__button mana-calculator__transparent-button'
onClick={() => handleDelete(id)}
>
Remove
Expand Down
2 changes: 1 addition & 1 deletion src/components/ManaCalculator/hooks/useResultsWithUnit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const getUnit = (value: number): Unit => {
let bestUnits: Unit = Unit.default;

const checkLength = Math.abs(value).toFixed(0).replace('.', '').length;
console.log(checkLength, value);

if (checkLength > UNIT_MAP.M.dp) {
bestUnits = Unit.M;
} else if (checkLength > UNIT_MAP.K.dp) {
Expand Down
9 changes: 9 additions & 0 deletions src/components/ManaCalculator/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,19 @@
padding: 10px;
}

.mana-calculator__transparent-button {
background-color: transparent !important;
}

.mana-calculator__button {
background-color: var(--ifm-color-emphasis-100);
margin: 0px;
margin-top: 1rem;
color: var(--ifm-font-color-base);
}

.mana-calculator__button:hover {
color: var(--ifm-font-color-base);
}

.mana-calculator__tooltip > p {
Expand Down