Skip to content
Merged
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
32 changes: 11 additions & 21 deletions pages/Transaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,18 @@ export function Transaction() {
<TransactionDetailRow
title="Payment Hash"
content={transaction.payment_hash}
copy
/>
{transaction.state === "settled" && (
<TransactionDetailRow
title="Preimage"
content={transaction.preimage}
copy
/>
)}
{metadata && (
<TransactionDetailRow
title="Metadata"
content={JSON.stringify(metadata, null, 2)}
className="ios:text-sm android:text-xs font-mono bg-muted p-2 rounded-md"
copy
/>
)}
</View>
Expand All @@ -304,32 +301,25 @@ export function Transaction() {
function TransactionDetailRow(props: {
title: string;
content: string;
copy?: boolean;
className?: string;
}) {
return (
<View className="flex flex-row gap-3">
<Text className="w-32 text-secondary-foreground">{props.title}</Text>
{props.copy ? (
<TouchableOpacity
className="flex-1"
onPress={() => {
Clipboard.setStringAsync(props.content);
Toast.show({
type: "success",
text1: "Copied to clipboard",
});
}}
>
<Text className={cn("font-medium2 flex-shrink", props.className)}>
{props.content}
</Text>
</TouchableOpacity>
) : (
<TouchableOpacity
className="flex-1"
onPress={() => {
Clipboard.setStringAsync(props.content);
Toast.show({
type: "success",
text1: "Copied to clipboard",
});
}}
>
Comment thread
im-adithya marked this conversation as resolved.
<Text className={cn("font-medium2 flex-shrink", props.className)}>
{props.content}
</Text>
)}
</TouchableOpacity>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
</View>
);
}
Expand Down
Loading