Skip to content

Commit 6c52209

Browse files
jurevanseuharrison
andauthored
feat/1383: Extension - Add apps link to accounts view (#1385)
Co-authored-by: Harrison Mendonça <[email protected]>
1 parent e7fa909 commit 6c52209

File tree

4 files changed

+44
-7
lines changed

4 files changed

+44
-7
lines changed

apps/extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@namada/extension",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"description": "Namada Keychain",
55
"repository": "https://github.com/anoma/namada-interface/",
66
"author": "Heliax Dev <[email protected]>",

apps/extension/src/App/Accounts/ParentAccounts.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Stack,
99
} from "@namada/components";
1010
import { DerivedAccount } from "@namada/types";
11+
import { ParentAccountsFooter } from "App/Accounts/ParentAccountsFooter";
1112
import { PageHeader } from "App/Common";
1213
import routes from "App/routes";
1314
import { ParentAccount } from "background/keyring";
@@ -43,9 +44,13 @@ export const ParentAccounts = (): JSX.Element => {
4344
};
4445

4546
return (
46-
<Stack gap={GapPatterns.TitleContent}>
47+
<Stack
48+
gap={GapPatterns.TitleContent}
49+
full
50+
className="max-h-[calc(100vh-40px)]"
51+
>
4752
<PageHeader title="Select Account" />
48-
<Stack gap={4}>
53+
<Stack gap={4} className="flex-1 overflow-auto">
4954
<nav className="grid items-end grid-cols-[auto_min-content]">
5055
<p className="text-white font-medium text-xs">Set default keys</p>
5156
<div className="w-26">
@@ -54,7 +59,7 @@ export const ParentAccounts = (): JSX.Element => {
5459
</ActionButton>
5560
</div>
5661
</nav>
57-
<Stack as="ul" gap={3}>
62+
<Stack as="ul" gap={3} className="flex-1 overflow-auto">
5863
{[...parentAccounts].reverse().map((account, idx) => (
5964
<KeyListItem
6065
key={`key-listitem-${account.id}`}
@@ -78,6 +83,7 @@ export const ParentAccounts = (): JSX.Element => {
7883
/>
7984
))}
8085
</Stack>
86+
<ParentAccountsFooter />
8187
</Stack>
8288
</Stack>
8389
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { ActionButton } from "@namada/components";
2+
import { GoArrowUpRight } from "react-icons/go";
3+
4+
export const ParentAccountsFooter = (): JSX.Element => {
5+
return (
6+
<div>
7+
<ActionButton
8+
href="https://namada.net/apps"
9+
target="_blank"
10+
rel="noreferrer"
11+
outlineColor="yellow"
12+
textHoverColor="black"
13+
itemType="button"
14+
icon={<GoArrowUpRight className="w-6 h-6" />}
15+
iconPosition="right"
16+
>
17+
View Keychain compatible apps
18+
</ActionButton>
19+
</div>
20+
);
21+
};

packages/components/src/ActionButton.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,23 @@ const actionButtonText = tv({
6767
),
6868
});
6969

70+
const actionButtonIcon = tv({
71+
base: "flex items-center justify-center absolute top-1/2 -translate-y-1/2 w-6 z-40",
72+
variants: {
73+
position: {
74+
left: "left-3",
75+
right: "right-3",
76+
},
77+
},
78+
});
79+
7080
type ButtonTailwindVariantsProps = VariantProps<typeof actionButtonShape> &
7181
VariantProps<typeof actionButtonBackground>;
7282

7383
export type ActionButtonProps<HtmlTag extends keyof React.ReactHTML> = {
7484
as?: HtmlTag;
7585
icon?: React.ReactNode;
86+
iconPosition?: "left" | "right";
7687
backgroundColor?: Color;
7788
backgroundHoverColor?: Color;
7889
outlineColor?: Color;
@@ -83,6 +94,7 @@ export type ActionButtonProps<HtmlTag extends keyof React.ReactHTML> = {
8394

8495
const Button = ({
8596
icon,
97+
iconPosition = "left",
8698
children,
8799
className,
88100
size,
@@ -136,9 +148,7 @@ const Button = ({
136148
},
137149
<>
138150
{icon && (
139-
<i className="flex items-center justify-center left-3 absolute top-1/2 -translate-y-1/2 w-6 z-40">
140-
{icon}
141-
</i>
151+
<i className={actionButtonIcon({ position: iconPosition })}>{icon}</i>
142152
)}
143153
<span className={actionButtonText()}>{children}</span>
144154
<span

0 commit comments

Comments
 (0)