Skip to content

Commit

Permalink
Chore/reusable collapse (#615)
Browse files Browse the repository at this point in the history
* remove again TransactionDialog components cluster

* add reusable Collapse

* add reusable LabeledCopyablePublicKey

* add BridgeFeeCollapse

* simplify TransferDialog logic
  • Loading branch information
Sharqiewicz authored Nov 1, 2024
1 parent 589851f commit 457fd1a
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 497 deletions.
20 changes: 20 additions & 0 deletions src/components/Collapse/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';

interface CollapseProps {
title: React.ReactNode;
children: React.ReactNode;
className?: string;
titleClassName?: string;
contentClassName?: string;
[key: string]: unknown;
}

export function Collapse({ title, children, className, titleClassName, contentClassName, ...rest }: CollapseProps) {
return (
<div tabIndex={0} className={`collapse collapse-arrow ${className || ''}`} {...rest}>
<input type="checkbox" />
<div className={`collapse-title ${titleClassName || ''}`}>{title}</div>
<div className={`collapse-content ${contentClassName || ''}`}>{children}</div>
</div>
);
}
16 changes: 16 additions & 0 deletions src/components/LabeledCopyablePublicKey/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { CopyablePublicKey } from '../PublicKey/CopyablePublicKey';

interface AddressDisplayProps {
label: string;
publicKey: string;
tenantName?: string;
showMemo?: boolean;
expectedStellarMemo?: string;
}

export const AddressDisplay: React.FC<AddressDisplayProps> = ({ label, publicKey }) => (
<div className="flex flex-row justify-between">
<div className="text-sm">{label}</div>
<CopyablePublicKey inline={true} className="p-0 text-sm" variant="short" publicKey={publicKey} />
</div>
);
Loading

0 comments on commit 457fd1a

Please sign in to comment.