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(gas card): gwei decimals + nit ui #212

Merged
merged 1 commit into from
Oct 16, 2024
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
22 changes: 12 additions & 10 deletions src/components/Molecules/GasCard/GasCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { Option } from "@/utils/option";
import { None, Some } from "@/utils/option";
import { useGoldRush } from "@/utils/store";
import type { GasCardData, GasCardProps } from "@/utils/types/molecules.types";
import type { GoldRushResponse } from "@covalenthq/client-sdk";
import { type GoldRushResponse } from "@covalenthq/client-sdk";
import { useEffect, useMemo, useState } from "react";

export const GasCard: React.FC<GasCardProps> = ({ chain_name }) => {
Expand Down Expand Up @@ -166,7 +166,7 @@ export const GasCard: React.FC<GasCardProps> = ({ chain_name }) => {
result?.[selectedValue]
.base_fee,
) ?? 0) / Math.pow(10, 9),
)}{" "}
).toFixed(2)}{" "}
Gwei
</p>
</div>
Expand Down Expand Up @@ -203,15 +203,17 @@ export const GasCard: React.FC<GasCardProps> = ({ chain_name }) => {
{Math.round(
Number(gas_price) /
Math.pow(10, 9),
).toFixed(0)}{" "}
).toFixed(2)}{" "}
Gwei
<span className="ml-1 text-sm text-secondary-light dark:text-secondary-dark">
(
{
pretty_total_gas_quote
}
)
</span>
{pretty_total_gas_quote && (
<span className="ml-1 text-sm text-secondary-light dark:text-secondary-dark">
(
{
pretty_total_gas_quote
}
)
</span>
)}
</p>

<p className="text-sm text-secondary-light dark:text-secondary-dark">
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ const buttonVariants = ({
default:
"bg-primary-light dark:bg-primary-dark text-foreground-light dark:text-foreground-dark shadow hover:bg-opacity-90",
primary:
"bg-primary-light dark:bg-primary-dark text-foreground-light dark:text-foreground-dark shadow hover:bg-opacity-90",
"bg-primary-light dark:bg-primary-dark text-foreground-light dark:text-foreground-dark shadow hover:bg-opacity-90 border-primary-light dark:border-primary-dark",
outline:
"text-foreground-light dark:text-foreground-dark border bg-background-light dark:bg-background-dark hover:bg-primary-light dark:hover:bg-primary-dark border-secondary-light dark:border-secondary-dark shadow-sm",
"text-foreground-light dark:text-foreground-dark border bg-background-light dark:bg-background-dark hover:border-primary-light dark:hover:border-primary-dark border-secondary-light dark:border-secondary-dark shadow-sm transition-all",
ghost: "hover:bg-primary-light hover:text-foreground-light dark:hover:bg-primary-dark dark:hover:text-foreground-dark",
link: "text-primary-light dark:text-primary-dark underline-offset-4 hover:underline",
};
Expand Down
Loading