Skip to content

Commit

Permalink
feat: add banner to migrate to alby hub for alby account users before…
Browse files Browse the repository at this point in the history
… march
  • Loading branch information
pavanjoshi914 committed Nov 21, 2024
1 parent fa670bf commit 5eed5d2
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/context/AccountContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface AccountContextType {
connectorType?: AccountInfo["connectorType"];
lightningAddress?: AccountInfo["lightningAddress"];
nodeRequired?: AccountInfo["nodeRequired"];
usingDiscontinuedWallet?: AccountInfo["usingDiscontinuedWallet"];
} | null;
balancesDecorated: {
fiatBalance: string;
Expand Down
26 changes: 26 additions & 0 deletions src/app/screens/Home/DefaultView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,32 @@ const DefaultView: FC<Props> = (props) => {
</div>
</Alert>
)}

{account?.usingDiscontinuedWallet && (
<Alert type="warn">
<div className="flex items-center gap-2">
<div className="shrink-0">
<PopiconsCircleExclamationLine className="w-5 h-5" />
</div>
<span className="text-sm">
<Trans
i18nKey={"default_view.using_discontinued_wallet"}
t={t}
components={[
// eslint-disable-next-line react/jsx-key
<Hyperlink
className="underline"
href="https://getalby.com/node/embrace_albyhub"
target="_blank"
rel="noopener nofollow"
/>,
]}
/>
</span>
</div>
</Alert>
)}

{account?.nodeRequired ? (
<Alert type="info">
<div className="flex items-center gap-2">
Expand Down
2 changes: 2 additions & 0 deletions src/common/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export interface AccountInfoRes {
pubkey?: string;
lightning_address?: string;
node_required?: boolean;
using_discontinued_wallet?: boolean;
};
name: string;
avatarUrl?: string;
Expand Down Expand Up @@ -121,6 +122,7 @@ export const swrGetAccountInfo = async (
avatarUrl,
lightningAddress: response.info.lightning_address,
nodeRequired: response.info.node_required,
usingDiscontinuedWallet: response.info.using_discontinued_wallet,
};
storeAccounts({
...accountsCache,
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@
"description": "Fund your account and receive via your lightning address or an invoice"
}
},
"upgrade_account": "You are using the old LNDHub setup. <0>Please re-connect</0> your Alby account to get access to the latest features."
"upgrade_account": "You are using the old LNDHub setup. <0>Please re-connect</0> your Alby account to get access to the latest features.",
"using_discontinued_wallet": "Alby Hub replaces your current Alby wallet in January 2025. <0>Update now</0>."
}
},
"accounts": {
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ export interface AccountInfo {
avatarUrl?: string;
lightningAddress?: string;
nodeRequired?: boolean;
usingDiscontinuedWallet?: boolean;
}

export type GetAccountInformationResponses = GetAccountInformationResponse & {
node_required: boolean;
using_discontinued_wallet: boolean;
limits?: {
max_send_volume: number;
max_send_amount: number;
Expand Down

0 comments on commit 5eed5d2

Please sign in to comment.