Skip to content

Commit

Permalink
fix: nit (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagnani73 committed Sep 20, 2024
1 parent c4adaa7 commit 0d4e430
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
20 changes: 9 additions & 11 deletions src/components/Atoms/Address/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ export const Address: React.FC<AddressProps> = ({
}

return (
<>
<p className="flex items-center gap-x-2">
{avatar && <AddressAvatar {...avatar} address={address} />}
<p className="flex items-center gap-x-1">
{avatar && <AddressAvatar {...avatar} address={address} />}

<CopyData data={address}>
{actionableWrapper(
actionable_address(address),
label?.trim() || truncate(address),
)}
</CopyData>
</p>
</>
{actionableWrapper(
actionable_address(address),
label?.trim() || truncate(address),
)}

<CopyData data={address} />
</p>
);
};
6 changes: 2 additions & 4 deletions src/components/Shared/CopyData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useToast } from "@/utils/hooks";
import { type CopyDataProps } from "@/utils/types/shared.types";
import { useState } from "react";

export const CopyData: React.FC<CopyDataProps> = ({ children, data }) => {
export const CopyData: React.FC<CopyDataProps> = ({ data }) => {
const [copied, showCopied] = useState<boolean>(false);

const { toast } = useToast();
Expand All @@ -26,13 +26,11 @@ export const CopyData: React.FC<CopyDataProps> = ({ children, data }) => {
<Toaster />

<button
className="cursor-pointer flex items-center gap-x-2"
className="cursor-pointer"
onClick={() => {
handleCopyClick();
}}
>
{children}

{copied ? (
<IconWrapper
icon_class_name="done"
Expand Down
1 change: 0 additions & 1 deletion src/utils/types/shared.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface CardDetailProps {

export interface CopyDataProps {
data: string;
children: React.ReactNode;
}

export interface IconWrapperProps {
Expand Down

0 comments on commit 0d4e430

Please sign in to comment.