Skip to content

Commit a73023a

Browse files
authored
fix: update all css for v2 transfer flow (#1981)
1 parent a42ecdf commit a73023a

File tree

11 files changed

+56
-58
lines changed

11 files changed

+56
-58
lines changed

apps/namadillo/src/App/AccountOverview/AccountOverview.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@ export const AccountOverview = (): JSX.Element => {
2020

2121
return (
2222
<PageWithSidebar>
23-
<div className="relative">
24-
<section className="w-full">
25-
<TotalBalanceBanner />
26-
<AssetsOverviewPanel />
27-
</section>
23+
<div className="flex flex-col">
24+
<TotalBalanceBanner />
25+
<AssetsOverviewPanel />
2826
</div>
2927
<Sidebar>
3028
<StakeSidebar />

apps/namadillo/src/App/AccountOverview/AssetsOverviewPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const AssetsOverviewPanel = (): JSX.Element => {
1818
title="IBC Transfer"
1919
activeTabIndex={currentTab}
2020
onChangeActiveTab={setCurrentTab}
21+
containerClassname="flex-1"
2122
className={clsx(
2223
"mt-2 transition-colors border-solid border border-transparent",
2324
"duration-0",

apps/namadillo/src/App/AccountOverview/ShieldedAssetsOverview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const ShieldedAssetsOverview = (): JSX.Element => {
1414
const requiresNewShieldedSync = useRequiresNewShieldedSync();
1515

1616
return (
17-
<Panel className="relative z-10 px-6 border border-yellow rounded-t-none -mt-px">
17+
<Panel className="relative z-10 px-6 border border-yellow rounded-t-none -mt-px h-full">
1818
<div className="flex items-center gap-16 mt-4">
1919
<TotalBalanceCard
2020
balanceInFiat={shieldedAmountInFiat}

apps/namadillo/src/App/AccountOverview/TotalBalanceBanner.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ export const TotalBalanceBanner = (): JSX.Element => {
6868
{/* <aside className="hidden lg:flex gap-4 items-center flex-wrap">
6969
<ActionButton
7070
onClick={() =>
71-
navigate(routes.shieldAssets, {
72-
state: { backgroundLocation: "" },
73-
})
71+
navigate(routes.shieldAssets)
7472
}
7573
size="sm"
7674
className="w-auto px-3 py-1.5"

apps/namadillo/src/App/AccountOverview/UnshieldedAssetTable.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ const TransparentTokensTable = ({
144144
Tokens
145145
</div>
146146
<TableWithPaginator
147-
containerClassName="h-screen"
148147
id="transparent-tokens"
149148
headers={headers.concat("")}
150149
renderRow={renderRow}
@@ -175,22 +174,22 @@ export const UnshieldedAssetTable = (): JSX.Element => {
175174
}, [transparentTokensQuery.data]);
176175

177176
return (
178-
<>
177+
<div className="flex flex-col flex-1">
179178
{transparentTokensQuery.isPending ?
180179
<SkeletonLoading height="100%" width="100%" />
181180
: <AtomErrorBoundary
182181
result={transparentTokensQuery}
183182
niceError="Unable to load your transparent balance"
184-
containerProps={{ className: "pb-16" }}
183+
containerProps={{ className: "pb-16 flex-1 flex flex-col" }}
185184
>
186185
{nonZeroTransparentTokens.length ?
187186
<TransparentTokensTable data={nonZeroTransparentTokens} />
188-
: <div className="bg-neutral-900 p-6 rounded-sm text-center font-medium mt-8">
187+
: <div className="bg-neutral-900 p-6 rounded-sm text-center font-medium mt-8 flex-1 flex items-center justify-center">
189188
You currently hold no assets in your unshielded account
190189
</div>
191190
}
192191
</AtomErrorBoundary>
193192
}
194-
</>
193+
</div>
195194
);
196195
};

apps/namadillo/src/App/AccountOverview/UnshieldedAssetsOverview.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import { routes } from "App/routes";
33
import { transparentTokensAtom } from "atoms/balance";
44
import { useAmountsInFiat } from "hooks/useAmountsInFiat";
55
import { useAtomValue } from "jotai";
6-
import { useLocation, useNavigate } from "react-router-dom";
6+
import { useNavigate } from "react-router-dom";
77
import { StakeYourNamCard } from "./StakeYourNamCard";
88
import { TotalBalanceCard } from "./TotalBalanceCard";
99
import { UnshieldedAssetTable } from "./UnshieldedAssetTable";
1010

1111
export const UnshieldedAssetsOverview = (): JSX.Element => {
1212
const { unshieldedAmountInFiat } = useAmountsInFiat();
13-
const location = useLocation();
1413
const navigate = useNavigate();
1514
const transparentTokensQuery = useAtomValue(transparentTokensAtom);
1615

@@ -20,18 +19,14 @@ export const UnshieldedAssetsOverview = (): JSX.Element => {
2019
!transparentTokensQuery.isFetched);
2120

2221
return (
23-
<Panel className="relative z-10 px-6 rounded-t-none -mt-px">
22+
<Panel className="relative z-10 px-6 rounded-t-none -mt-px h-full">
2423
<div className="flex justify-between items-center gap-16 mt-4">
2524
<TotalBalanceCard
2625
balanceInFiat={unshieldedAmountInFiat}
2726
footerButtons={
2827
<>
2928
<ActionButton
30-
onClick={() =>
31-
navigate(routes.shieldAssets, {
32-
state: { backgroundLocation: location },
33-
})
34-
}
29+
onClick={() => navigate(routes.maspShield)}
3530
size="xs"
3631
className="w-auto px-4"
3732
>

apps/namadillo/src/App/Common/TableWithPaginator.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ type TableWithPaginatorProps<T> = {
1212
pageCount?: number;
1313
onPageChange?: (page: number) => void;
1414
children?: React.ReactNode;
15-
containerClassName?: string;
1615
} & Pick<React.ComponentProps<typeof StyledTable>, "tableProps" | "headProps">;
1716

1817
export const TableWithPaginator = <T,>({
@@ -26,7 +25,6 @@ export const TableWithPaginator = <T,>({
2625
children,
2726
tableProps,
2827
headProps,
29-
containerClassName,
3028
}: TableWithPaginatorProps<T>): JSX.Element => {
3129
const containerRef = useRef<HTMLDivElement>(null);
3230
const [rows, setRows] = useState<TableRow[]>([]);
@@ -82,7 +80,6 @@ export const TableWithPaginator = <T,>({
8280
<div
8381
ref={containerRef}
8482
className={clsx(
85-
containerClassName,
8683
"grid grid-rows-[1fr_auto] flex-1 overflow-hidden w-full gap-2"
8784
)}
8885
>

apps/namadillo/src/App/Masp/ShieldedAssetTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const ShieldedAssetTable = (): JSX.Element => {
6363
<AtomErrorBoundary
6464
result={shieldedTokensQuery}
6565
niceError="Unable to load your shielded balance"
66-
containerProps={{ className: "pb-16" }}
66+
containerProps={{ className: "pb-16 flex-1 flex flex-col" }}
6767
>
6868
{isNftEnabled && (
6969
<div className="flex mb-6">

apps/namadillo/src/App/Masp/ShieldedFungibleTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ export const ShieldedFungibleTable = ({
143143
Tokens
144144
</div>
145145
<TableWithPaginator
146-
containerClassName="h-screen"
147146
id="shielded-tokens"
148147
headers={headers.concat("")}
149148
renderRow={renderRow}

apps/namadillo/src/App/Transactions/TransactionHistory.tsx

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,39 @@ export const TransactionHistory = (): JSX.Element => {
1717
const { clearMyCompleteTransactions } = useTransactionActions();
1818

1919
return (
20-
<>
21-
<Panel className="flex flex-col gap-6 flex-1">
22-
<h2 className="mb-7">Transfers made by this device</h2>
23-
{pending.length > 0 && (
24-
<section>
25-
<h2 className="text-sm mb-3">In Progress</h2>
26-
<TransactionList transactions={pending.toReversed()} />
27-
</section>
28-
)}
29-
{complete.length > 0 && (
30-
<section>
31-
<header className="flex justify-between text-sm">
32-
<h2 className="mb-3">History</h2>
33-
<button
34-
className="text-white"
35-
onClick={clearMyCompleteTransactions}
36-
>
37-
Clear all
38-
</button>
39-
</header>
40-
<TransactionList transactions={complete.toReversed()} />
41-
</section>
42-
)}
43-
{hasNoTransactions && (
44-
<p className="font-light">No transactions saved on this device</p>
45-
)}
20+
<div
21+
className="flex flex-col min-h-full"
22+
style={{ height: "calc(100vh - 180px)" }}
23+
>
24+
<Panel className="flex-auto flex flex-col overflow-auto">
25+
<div className="rounded-sm bg-black px-4 py-5 text-white font-medium flex flex-col gap-6 flex-1">
26+
<h2 className="mb-7">Transfers made by this device</h2>
27+
{pending.length > 0 && (
28+
<section>
29+
<h2 className="text-sm mb-3">In Progress</h2>
30+
<TransactionList transactions={pending.toReversed()} />
31+
</section>
32+
)}
33+
{complete.length > 0 && (
34+
<section>
35+
<header className="flex justify-between text-sm">
36+
<h2 className="mb-3">History</h2>
37+
<button
38+
className="text-white"
39+
onClick={clearMyCompleteTransactions}
40+
>
41+
Clear all
42+
</button>
43+
</header>
44+
<TransactionList transactions={complete.toReversed()} />
45+
</section>
46+
)}
47+
{hasNoTransactions && (
48+
<p className="font-light">No transactions saved on this device</p>
49+
)}
50+
</div>
4651
</Panel>
47-
<NavigationFooter className="mt-2" />
48-
</>
52+
<NavigationFooter className="mt-2 flex-none h-16" />
53+
</div>
4954
);
5055
};

0 commit comments

Comments
 (0)