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

chore: wallet clean up #734

Merged
merged 1 commit into from
Jun 27, 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
chore: wallet clean up
  • Loading branch information
kyhyco committed Jun 27, 2024
commit fbcdf43f51faff345e90403ce5c9ba07f6ff3566
4 changes: 2 additions & 2 deletions src/identity/components/Identity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function Identity({
children,
className,
schemaId,
copyAddressOnClick,
hasCopyAddressOnClick = false,
}: IdentityReact) {
// istanbul ignore next
const handleCopy = useCallback(async () => {
Expand All @@ -24,7 +24,7 @@ export function Identity({
}, [address]);

// istanbul ignore next
const onClick = copyAddressOnClick ? handleCopy : undefined;
const onClick = hasCopyAddressOnClick ? handleCopy : undefined;

return (
<IdentityProvider address={address} schemaId={schemaId}>
Expand Down
26 changes: 6 additions & 20 deletions src/identity/components/IdentityLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,28 +125,14 @@ export function IdentityLayout({
</div>
{showPopover && (
<div
className={cn(background.inverse, color.foreground, 'absolute z-10')}
style={{
top: 'calc(100% - 5px)',
left: '46px',
boxShadow: '0px 4px 8px rgba(0, 0, 0, 0.1)',
borderRadius: '5px',
padding: '5px 10px',
}}
className={cn(
background.inverse,
color.foreground,
'absolute top-[calc(100%_-_5px)] left-[46px] z-10 rounded px-2 py-1 shadow-[0px_4px_8px_rgba(0,0,0,0.1)]',
)}
>
{popoverText}
<div
style={{
position: 'absolute',
top: '-5px',
left: '24px',
width: '0',
height: '0',
borderLeft: '5px solid transparent',
borderRight: '5px solid transparent',
borderBottom: '5px solid var(--bg-inverse)',
}}
/>
<div className="absolute top-[-5px] left-6 h-0 w-0 border-x-[5px] border-x-transparent border-b-[5px] border-b-[color:var(--bg-inverse)] border-solid" />
</div>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/identity/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export type IdentityReact = {
children: ReactNode;
className?: string; // Optional className override for top div element.
schemaId?: Address | null; // The Ethereum address of the schema to use for EAS attestation.
copyAddressOnClick?: boolean;
hasCopyAddressOnClick?: boolean;
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/utils/getRoundedAmount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export function getRoundedAmount(balance: string, fractionDigits: number) {
?.toFixed(fractionDigits)
.replace(/0+$/, '');

// checking if balance is more than 0 but less than fractionDigits
// without this prints "0."
if (parsedBalance > 0 && Number.parseFloat(result) === 0) {
return '0';
}
Expand Down