Skip to content

Commit

Permalink
chore: polish
Browse files Browse the repository at this point in the history
  • Loading branch information
Zizzamia committed Jun 13, 2024
1 parent 1cd548a commit aa07b37
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .changeset/fuzzy-eggs-cross.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@coinbase/onchainkit": patch
---

- **feat**: introduce Inter font-family and internal text components. By @kyhyco #506
- **feat**: introduce `Inter` font-family and internal text components. By @kyhyco #506
4 changes: 2 additions & 2 deletions src/internal/text/TextBody.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ReactNode } from 'react';
import type { ReactNode } from 'react';

type TextBodyReact = {
children: ReactNode;
};

export function TextBody({ children }: TextBodyReact) {
return (
<span className="text-sans text-base leading-normal text-black">
<span className='text-base text-black text-sans leading-normal'>
{children}
</span>
);
Expand Down
4 changes: 2 additions & 2 deletions src/internal/text/TextCaption.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import type { ReactNode } from 'react';

type TextCaptionReact = {
children: ReactNode;
Expand All @@ -7,6 +7,6 @@ type TextCaptionReact = {
/* istanbul ignore next */
export function TextCaption({ children }: TextCaptionReact) {
return (
<span className="text-sans text-bold text-xs leading-4">{children}</span>
<span className='text-bold text-sans text-xs leading-4'>{children}</span>
);
}
4 changes: 2 additions & 2 deletions src/internal/text/TextHeadline.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ReactNode } from 'react';
import type { ReactNode } from 'react';

type TextHeadlineReact = {
children: ReactNode;
};

export function TextHeadline({ children }: TextHeadlineReact) {
return (
<span className="text-sans text-base leading-normal text-bold text-[#0A0B0D]">
<span className='text-[#0A0B0D] text-base text-bold text-sans leading-normal'>
{children}
</span>
);
Expand Down
4 changes: 2 additions & 2 deletions src/internal/text/TextLabel1.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import type { ReactNode } from 'react';

type TextLabel1React = {
children: ReactNode;
Expand All @@ -7,7 +7,7 @@ type TextLabel1React = {
/* istanbul ignore next */
export function TextLabel1({ children }: TextLabel1React) {
return (
<span className="text-sans text-bold text-sm leading-5 text-[#0A0B0D]">
<span className='text-[#0A0B0D] text-bold text-sans text-sm leading-5'>
{children}
</span>
);
Expand Down
4 changes: 2 additions & 2 deletions src/internal/text/TextLabel2.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import type { ReactNode } from 'react';

type TextLabel2React = {
children: ReactNode;
Expand All @@ -7,7 +7,7 @@ type TextLabel2React = {
/* istanbul ignore next */
export function TextLabel2({ children }: TextLabel2React) {
return (
<span className="text-sans text-sm leading-5 text-[#0A0B0D]">
<span className='text-[#0A0B0D] text-sans text-sm leading-5'>
{children}
</span>
);
Expand Down
2 changes: 1 addition & 1 deletion src/internal/text/TextLegal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode } from 'react';
import type { ReactNode } from 'react';

type TextLegalReact = {
children: ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion src/swap/components/SwapAmountInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { render, screen, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
import { SwapAmountInput } from './SwapAmountInput';
import { SwapContext } from '../context';
import { type Token } from '../../token';
import type { Token } from '../../token';
import type { SwapContextType } from '../types';
import type { Address } from 'viem';

Expand Down
6 changes: 3 additions & 3 deletions src/swap/components/SwapAmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function SwapAmountInput({ label, token, type }: SwapAmountInputReact) {
<div className="flex w-full items-center justify-between">
<label className="font-semibold text-[#030712] text-sm">{label}</label>
{roundedBalance && (
<label className="text-sm font-normal text-gray-400">{`Balance: ${roundedBalance}`}</label>
<label className='font-normal text-gray-400 text-sm'>{`Balance: ${roundedBalance}`}</label>
)}
</div>
<div className="flex w-full items-center justify-between">
Expand All @@ -92,8 +92,8 @@ export function SwapAmountInput({ label, token, type }: SwapAmountInputReact) {
<button
className={cn(
'flex h-8 w-[58px] max-w-[200px] items-center rounded-[40px]',
'bg-gray-100 px-3 py-2 text-base font-medium',
'not-italic leading-6 text-gray-500',
'bg-gray-100 px-3 py-2 font-medium text-base',
'text-gray-500 not-italic leading-6',
)}
data-testid="ockSwapAmountInput_MaxButton"
disabled={roundedBalance === undefined}
Expand Down
4 changes: 2 additions & 2 deletions src/swap/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ export function isSwapError(response: unknown): response is SwapError {

export function formatTokenAmount(amount: string, decimals: number) {
// Convert the string amount to a number using decimals value
const numberAmount = Number(amount) / Math.pow(10, decimals);
const numberAmount = Number(amount) / 10 ** decimals;
return numberAmount.toString();
}

export function getRoundedAmount(balance: string, fractionDigits: number) {
const parsedBalance = parseFloat(balance);
const parsedBalance = Number.parseFloat(balance);
return Number(parsedBalance)?.toFixed(fractionDigits).replace(/0+$/, '');
}
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '0.20.6';
export const version = '0.20.7';

0 comments on commit aa07b37

Please sign in to comment.