From c0b99832a2b50682029b77c476a3be7f9805a7c5 Mon Sep 17 00:00:00 2001 From: DaviPtrs Date: Thu, 30 Jan 2025 14:27:04 -0300 Subject: [PATCH 1/4] Revert "feat: add WalletSkeletonLoader component for improved loading experience" This reverts commit e8662e6a16085429962d0e9dfee7031535e85f5e. --- .../src/app/components/actions/index.tsx | 4 ++ .../src/app/components/actions/receive.tsx | 36 ---------------- .../src/app/components/sidebar-links.tsx | 22 +--------- .../src/app/components/wallet-actions.tsx | 6 +-- .../app/components/wallet-skeleton-loader.tsx | 41 ------------------- apps/torus-wallet/src/app/page.tsx | 4 +- apps/torus-wallet/src/app/staking/page.tsx | 4 +- 7 files changed, 11 insertions(+), 106 deletions(-) create mode 100644 apps/torus-wallet/src/app/components/actions/index.tsx delete mode 100644 apps/torus-wallet/src/app/components/actions/receive.tsx delete mode 100644 apps/torus-wallet/src/app/components/wallet-skeleton-loader.tsx diff --git a/apps/torus-wallet/src/app/components/actions/index.tsx b/apps/torus-wallet/src/app/components/actions/index.tsx new file mode 100644 index 000000000..b0e8b0cc9 --- /dev/null +++ b/apps/torus-wallet/src/app/components/actions/index.tsx @@ -0,0 +1,4 @@ +export { SendAction } from "./send" +export { StakeAction } from "./stake" +export { TransferStakeAction } from "./transfer-stake" +export { UnstakeAction } from "./unstake" \ No newline at end of file diff --git a/apps/torus-wallet/src/app/components/actions/receive.tsx b/apps/torus-wallet/src/app/components/actions/receive.tsx deleted file mode 100644 index 611b25fc9..000000000 --- a/apps/torus-wallet/src/app/components/actions/receive.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { toast } from "@torus-ts/toast-provider"; -import { Button, Card } from "@torus-ts/ui"; -import { copyToClipboard } from "@torus-ts/ui/utils"; -import { smallAddress } from "@torus-ts/utils/subspace"; -import { useWallet } from "~/context/wallet-provider"; - -export function ReceiveAction() { - const { selectedAccount } = useWallet(); - const handleCopyAddress = async (address: string) => { - await copyToClipboard(address); - toast.success("Address copied to clipboard"); - }; - return ( - -

To receive TORUS, share your address with the sender.

- {selectedAccount?.address ? ( -
- - Connected account: {smallAddress(selectedAccount.address)} - - -
- ) : ( - - Connect your wallet to view your address - - )} -
- ); -} diff --git a/apps/torus-wallet/src/app/components/sidebar-links.tsx b/apps/torus-wallet/src/app/components/sidebar-links.tsx index bb9ad07c1..34953ac06 100644 --- a/apps/torus-wallet/src/app/components/sidebar-links.tsx +++ b/apps/torus-wallet/src/app/components/sidebar-links.tsx @@ -2,7 +2,7 @@ import Link from "next/link"; import { Check } from "lucide-react"; -import { usePathname, useRouter } from "next/navigation"; +import { usePathname } from "next/navigation"; import { Button, @@ -20,7 +20,6 @@ import { env } from "~/env"; export const SidebarLinks = () => { const chainEnv = env("NEXT_PUBLIC_TORUS_CHAIN_ENV"); const pathname = usePathname(); - const router = useRouter(); const bridgeLink = chainEnv === "mainnet" @@ -29,26 +28,9 @@ export const SidebarLinks = () => { const isActive = (path: string) => pathname === path; - const handleSelectChange = (value: string) => { - switch (value) { - case "wallet": - router.push("/"); - break; - case "staking": - router.push("/staking"); - break; - case "bridge": - router.push(bridgeLink); - break; - } - }; - return ( <> - diff --git a/apps/torus-wallet/src/app/components/wallet-actions.tsx b/apps/torus-wallet/src/app/components/wallet-actions.tsx index 5b0069fa3..fc9040596 100644 --- a/apps/torus-wallet/src/app/components/wallet-actions.tsx +++ b/apps/torus-wallet/src/app/components/wallet-actions.tsx @@ -6,12 +6,8 @@ import { SendAction } from "./actions/send"; import { StakeAction } from "./actions/stake"; import { TransferStakeAction } from "./actions/transfer-stake"; import { UnstakeAction } from "./actions/unstake"; -import { ReceiveAction } from "./actions/receive"; -const transferButtons = [ - { text: "Send", component: }, - { text: "Receive", component: }, -]; +const transferButtons = [{ text: "Send", component: }]; const stakingButtons = [ { text: "Stake", component: }, diff --git a/apps/torus-wallet/src/app/components/wallet-skeleton-loader.tsx b/apps/torus-wallet/src/app/components/wallet-skeleton-loader.tsx deleted file mode 100644 index 82003eb01..000000000 --- a/apps/torus-wallet/src/app/components/wallet-skeleton-loader.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import React from "react"; -import { Card } from "@torus-ts/ui"; - -export function WalletSkeletonLoader() { - return ( -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- {[1, 2, 3].map((item) => ( -
-
-
-
- ))} -
-
-
-
-
- ); -} diff --git a/apps/torus-wallet/src/app/page.tsx b/apps/torus-wallet/src/app/page.tsx index 6ee419335..4efc2144f 100644 --- a/apps/torus-wallet/src/app/page.tsx +++ b/apps/torus-wallet/src/app/page.tsx @@ -1,11 +1,11 @@ import { Suspense } from "react"; +import { Loading } from "@torus-ts/ui"; import WalletActions from "./components/wallet-actions"; -import { WalletSkeletonLoader } from "./components/wallet-skeleton-loader"; export default function Page(): JSX.Element { return ( - }> + }> ); diff --git a/apps/torus-wallet/src/app/staking/page.tsx b/apps/torus-wallet/src/app/staking/page.tsx index 3cb8f885d..e9a800b38 100644 --- a/apps/torus-wallet/src/app/staking/page.tsx +++ b/apps/torus-wallet/src/app/staking/page.tsx @@ -1,11 +1,11 @@ import { Suspense } from "react"; +import { Loading } from "@torus-ts/ui"; import WalletActions from "../components/wallet-actions"; -import { WalletSkeletonLoader } from "../components/wallet-skeleton-loader"; export default function Page(): JSX.Element { return ( - }> + }> ); From b2d45c57f246586e2479013f109bb409c97013e2 Mon Sep 17 00:00:00 2001 From: DaviPtrs Date: Thu, 30 Jan 2025 14:28:36 -0300 Subject: [PATCH 2/4] test pull_request.base.sha --- .github/actions/check-turbo-changes/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/check-turbo-changes/action.yml b/.github/actions/check-turbo-changes/action.yml index dace2ad0b..28a24ee3f 100644 --- a/.github/actions/check-turbo-changes/action.yml +++ b/.github/actions/check-turbo-changes/action.yml @@ -58,7 +58,7 @@ runs: if: github.event_name == 'pull_request' shell: bash run: | - pnpm exec turbo run build --filter="...[origin/${{ github.base_ref }}]" --dry-run=json 2>/dev/null > build.json + pnpm exec turbo run build --filter="...[${{ github.event.pull_request.base.sha }}]" --dry-run=json 2>/dev/null > build.json - name: Get build json (Push based) if: github.event_name == 'push' From 0a114a1f9a4a22afb4902fd2fb473e2b4a874c11 Mon Sep 17 00:00:00 2001 From: DaviPtrs Date: Thu, 30 Jan 2025 14:35:37 -0300 Subject: [PATCH 3/4] a --- .github/workflows/debug.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 949776026..299f0ee62 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -21,7 +21,7 @@ jobs: - name: Build torus-page if: steps.changes.outputs.torus-page == 'true' - run: echo "Building torus-page..." + run: echo "Building torus-page... " # Debug output - name: Show changes From 5d702cbc17ec608947f7ec866e54d079da2249b6 Mon Sep 17 00:00:00 2001 From: DaviPtrs Date: Thu, 30 Jan 2025 14:38:39 -0300 Subject: [PATCH 4/4] change pr base --- .github/actions/check-turbo-changes/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/check-turbo-changes/action.yml b/.github/actions/check-turbo-changes/action.yml index 28a24ee3f..dace2ad0b 100644 --- a/.github/actions/check-turbo-changes/action.yml +++ b/.github/actions/check-turbo-changes/action.yml @@ -58,7 +58,7 @@ runs: if: github.event_name == 'pull_request' shell: bash run: | - pnpm exec turbo run build --filter="...[${{ github.event.pull_request.base.sha }}]" --dry-run=json 2>/dev/null > build.json + pnpm exec turbo run build --filter="...[origin/${{ github.base_ref }}]" --dry-run=json 2>/dev/null > build.json - name: Get build json (Push based) if: github.event_name == 'push'