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: nit #202

Merged
merged 1 commit into from
Sep 20, 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
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
Loading