Skip to content

Commit 25b0223

Browse files
committed
Refactor wallet info components for improved UI and functionality
- Updated card components to enhance layout and styling consistency. - Refactored InspectMultisigScript and InspectScript to use CardUI for better presentation. - Improved the handling of wallet state and balance display in ShowInfo and related components. - Enhanced user experience with collapsible sections for advanced script details and improved messaging for wallet actions. - Adjusted styles for alerts and buttons to ensure better visibility and interaction. - Added Discord integration for signer profiles to enhance user engagement.
1 parent 7cef982 commit 25b0223

22 files changed

+653
-271
lines changed

src/components/multisig/inspect-multisig-script.tsx

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import CardUI from "@/components/common/card-content";
2-
import Code from "@/components/common/code";
1+
import CardUI from "@/components/ui/card-content";
2+
import Code from "@/components/ui/code";
33
import RowLabelInfo from "@/components/common/row-label-info";
44
import { type MultisigWallet } from "@/utils/multisigSDK";
55
import { Carousel } from "@/components/ui/carousel";
@@ -88,37 +88,36 @@ export default function InspectMultisigScript({
8888
}
8989

9090
return (
91-
<div className="col-span-2 w-full rounded-xl border border-zinc-200 bg-white text-zinc-950 shadow dark:border-zinc-800 dark:bg-zinc-950 dark:text-zinc-50">
92-
<div className="flex flex-row items-center justify-between space-y-0 pb-2 p-6">
93-
<h3 className="text-xl font-medium">Native Script</h3>
94-
</div>
95-
<div className="p-6 pt-0">
91+
<CardUI
92+
title="Native Script"
93+
description="Advanced script details for SDK-managed wallets"
94+
cardClassName="col-span-2"
95+
>
96+
<div className="mt-1 flex flex-col gap-2">
9697
<div className="mt-1 flex flex-col gap-2">
97-
<div className="mt-1 flex flex-col gap-2">
98-
{mWallet.stakingEnabled() && <RowLabelInfo
99-
label="Address"
100-
value={<Code>{mWallet.getScript().address}</Code>}
101-
copyString={mWallet.getScript().address}
102-
/>}
103-
<RowLabelInfo label="Balance" value={<Code>{`${balance} ₳`}</Code>} />
104-
{mWallet.stakingEnabled() && (
105-
<RowLabelInfo
106-
label="Stake Address"
107-
value={<Code>{mWallet.getStakeAddress()}</Code>}
108-
copyString={mWallet.getStakeAddress()}
109-
/>
110-
)}
111-
{/* add pending rewards like balance */}
112-
{mWallet.isGovernanceEnabled() && <RowLabelInfo
113-
label="dRep ID"
114-
value={<Code>{mWallet.getDRepId()}</Code>}
115-
copyString={mWallet.getDRepId()}
116-
/>}
98+
{mWallet.stakingEnabled() && <RowLabelInfo
99+
label="Address"
100+
value={<Code>{mWallet.getScript().address}</Code>}
101+
copyString={mWallet.getScript().address}
102+
/>}
103+
<RowLabelInfo label="Balance" value={<Code>{`${balance} ₳`}</Code>} />
104+
{mWallet.stakingEnabled() && (
105+
<RowLabelInfo
106+
label="Stake Address"
107+
value={<Code>{mWallet.getStakeAddress()}</Code>}
108+
copyString={mWallet.getStakeAddress()}
109+
/>
110+
)}
111+
{/* add pending rewards like balance */}
112+
{mWallet.isGovernanceEnabled() && <RowLabelInfo
113+
label="dRep ID"
114+
value={<Code>{mWallet.getDRepId()}</Code>}
115+
copyString={mWallet.getDRepId()}
116+
/>}
117117

118-
<Carousel slides={slides} />
119-
</div>
118+
<Carousel slides={slides} />
120119
</div>
121120
</div>
122-
</div>
121+
</CardUI>
123122
);
124123
}

src/components/pages/wallet/info/archive-wallet.tsx

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,34 @@ export function ArchiveWallet({ appWallet }: { appWallet: Wallet }) {
4242
return (
4343
<CardUI
4444
title="Archive Wallet"
45-
description="Archive this wallet"
45+
description="Archive this wallet to remove it from your wallet list"
4646
cardClassName="col-span-2"
4747
>
48-
<p>
49-
Archiving this wallet will remove it from your list of wallets. You can
50-
always restore it later.
51-
</p>
52-
<div>
53-
{appWallet.isArchived ? (
54-
<Button onClick={() => archiveWallet(false)} variant="default">
55-
Restore Wallet
56-
</Button>
57-
) : (
58-
<Button onClick={() => archiveWallet(true)} variant="destructive">
59-
Archive Wallet
60-
</Button>
61-
)}
48+
<div className="space-y-4">
49+
<p className="text-sm text-muted-foreground">
50+
{appWallet.isArchived
51+
? "This wallet is currently archived and hidden from your wallet list."
52+
: "Archiving this wallet will remove it from your list of wallets. You can always restore it later."}
53+
</p>
54+
<div className="flex flex-col sm:flex-row gap-3">
55+
{appWallet.isArchived ? (
56+
<Button
57+
onClick={() => archiveWallet(false)}
58+
variant="default"
59+
className="w-full sm:w-auto"
60+
>
61+
Restore Wallet
62+
</Button>
63+
) : (
64+
<Button
65+
onClick={() => archiveWallet(true)}
66+
variant="destructive"
67+
className="w-full sm:w-auto"
68+
>
69+
Archive Wallet
70+
</Button>
71+
)}
72+
</div>
6273
</div>
6374
</CardUI>
6475
);

0 commit comments

Comments
 (0)