From 7828afb68e5d936e147e51e06aeada8ebb8b50fe Mon Sep 17 00:00:00 2001 From: Manan Tank Date: Thu, 25 Sep 2025 04:16:34 +0530 Subject: [PATCH] Portal: UI tweaks --- apps/portal/src/app/Header.tsx | 98 +++++++++---------- apps/portal/src/app/transactions/page.mdx | 86 ++++++++-------- .../src/app/transactions/sponsor/page.mdx | 2 + apps/portal/src/components/AI/chat-button.tsx | 6 +- .../components/Document/AuthMethodsTabs.tsx | 16 +-- apps/portal/src/components/Document/Code.tsx | 2 +- .../src/components/Document/DocLink.tsx | 2 +- apps/portal/src/components/Document/Grid.tsx | 2 +- .../src/components/Document/InlineCode.tsx | 2 +- .../src/components/Document/PageFooter.tsx | 33 ++++--- .../src/components/Document/SDKCard.tsx | 8 +- .../src/components/Layouts/DocLayout.tsx | 4 +- .../src/components/others/DocSearch.tsx | 4 +- .../portal/src/components/others/Feedback.tsx | 44 +++++---- apps/portal/src/components/others/Sidebar.tsx | 29 +++--- .../src/components/others/Subscribe.tsx | 13 +-- .../src/components/others/TableOfContents.tsx | 8 +- apps/portal/src/components/ui/tabs.tsx | 9 +- .../components/code/CodeBlockContainer.tsx | 2 +- 19 files changed, 184 insertions(+), 186 deletions(-) diff --git a/apps/portal/src/app/Header.tsx b/apps/portal/src/app/Header.tsx index 9445db0c44b..ee7ff7cfeb4 100644 --- a/apps/portal/src/app/Header.tsx +++ b/apps/portal/src/app/Header.tsx @@ -213,7 +213,7 @@ export function Header() { const pathname = usePathname(); return ( -
+
{/* Top row */}
@@ -230,7 +230,7 @@ export function Header() {
-
+
{/* Bottom row - hidden on mobile */} -
+
-
-
- setShowBurgerMenu(false)} - /> -
-
- setShowBurgerMenu(false)} - /> -
-
- setShowBurgerMenu(false)} - /> -
- -
- setShowBurgerMenu(false)} - /> -
+
+ setShowBurgerMenu(false)} + /> + setShowBurgerMenu(false)} + /> + setShowBurgerMenu(false)} + /> -
- setShowBurgerMenu(false)} - /> -
+ setShowBurgerMenu(false)} + /> + setShowBurgerMenu(false)} + /> { setShowBurgerMenu(false); @@ -448,31 +442,29 @@ function DropdownLinks(props: { {props.links.map((info) => { return (
{info.icon && ( - + )} void; icon?: React.FC<{ className?: string }>; + className?: string; }) { const pathname = usePathname(); return ( @@ -534,6 +527,7 @@ function NavLink(props: { ? "text-foreground" : "text-muted-foreground", props.icon ? "flex flex-row gap-3" : "", + props.className, )} href={props.href} onClick={props.onClick} diff --git a/apps/portal/src/app/transactions/page.mdx b/apps/portal/src/app/transactions/page.mdx index 75a49c3a205..6e2d3791a26 100644 --- a/apps/portal/src/app/transactions/page.mdx +++ b/apps/portal/src/app/transactions/page.mdx @@ -70,9 +70,9 @@ Send, monitor, and manage transactions. Send transactions from user or server wa - For user wallets in React applications that use the SDK, you can obtain the user wallet auth token (JWT) with the [`useAuthToken()`](/references/typescript/v5/useAuthToken) hook. - For user wallets in TypeScript applications, you can get it by calling `wallet.getAuthToken()` on a connected [`inAppWallet()`](/references/typescript/v5/inAppWallet) or [`ecosystemWallet()`](/references/typescript/v5/ecosystemWallet). - + - + ### Installation @@ -425,47 +425,47 @@ Send, monitor, and manage transactions. Send transactions from user or server wa 2. Enter your Client ID from the thirdweb dashboard 3. Allowlist your game's Bundle ID on the thirdweb dashboard for security - ### Send a Transaction - - Create a new script to manage transactions: - - ```csharp - using Thirdweb; - using UnityEngine; - using UnityEngine.UI; - - public class TransactionManager : MonoBehaviour - { - private ThirdwebSDK sdk; - public Text walletAddressText; - public Button sendButton; - - void Start() - { - // Client ID is set in Project Settings > Thirdweb - sdk = new ThirdwebSDK("ethereum"); // Or any supported chain - sendButton.onClick.AddListener(SendTransaction); - } - - public async void SendTransaction() - { - try { - var contract = await ThirdwebManager.Instance.GetContract( - address: "contract-address", - chainId: 1, - abi: "optional-abi" - ); - - // Send a transaction - var receipt = await contract.Write(wallet, contract, "transfer", weiValue, toAddress, amount); - Debug.Log($"Transaction receipt: {receipt}"); - } - catch (System.Exception e) { - Debug.LogError("Error sending transaction: " + e.Message); - } - } - } - ``` + ### Send a Transaction + + Create a new script to manage transactions: + + ```csharp + using Thirdweb; + using UnityEngine; + using UnityEngine.UI; + + public class TransactionManager : MonoBehaviour + { + private ThirdwebSDK sdk; + public Text walletAddressText; + public Button sendButton; + + void Start() + { + // Client ID is set in Project Settings > Thirdweb + sdk = new ThirdwebSDK("ethereum"); // Or any supported chain + sendButton.onClick.AddListener(SendTransaction); + } + + public async void SendTransaction() + { + try { + var contract = await ThirdwebManager.Instance.GetContract( + address: "contract-address", + chainId: 1, + abi: "optional-abi" + ); + + // Send a transaction + var receipt = await contract.Write(wallet, contract, "transfer", weiValue, toAddress, amount); + Debug.Log($"Transaction receipt: {receipt}"); + } + catch (System.Exception e) { + Debug.LogError("Error sending transaction: " + e.Message); + } + } + } + ``` diff --git a/apps/portal/src/app/transactions/sponsor/page.mdx b/apps/portal/src/app/transactions/sponsor/page.mdx index f718deb7abd..2cae8b88f13 100644 --- a/apps/portal/src/app/transactions/sponsor/page.mdx +++ b/apps/portal/src/app/transactions/sponsor/page.mdx @@ -103,6 +103,8 @@ Example sponsored contract write request: +
+ That's it! All transactions executed by the user will be sponsored via the thirdweb infrastructure. diff --git a/apps/portal/src/components/AI/chat-button.tsx b/apps/portal/src/components/AI/chat-button.tsx index 6f96ba5d9d3..4ad8de27500 100644 --- a/apps/portal/src/components/AI/chat-button.tsx +++ b/apps/portal/src/components/AI/chat-button.tsx @@ -20,14 +20,14 @@ export function ChatButton() { <> {/* Inline Button (not floating) */} diff --git a/apps/portal/src/components/Document/AuthMethodsTabs.tsx b/apps/portal/src/components/Document/AuthMethodsTabs.tsx index b4062389ac8..07fc2d36bab 100644 --- a/apps/portal/src/components/Document/AuthMethodsTabs.tsx +++ b/apps/portal/src/components/Document/AuthMethodsTabs.tsx @@ -16,6 +16,7 @@ import { } from "@/icons"; import { cn } from "@/lib/utils"; import { CodeClient } from "../code/code.client"; +import { Button } from "../ui/button"; type AuthMethod = | "email" @@ -849,16 +850,15 @@ function AuthMethodsTabsContent() {
{authMethods.map((method) => ( - +
{method.label}
+ ))}
diff --git a/apps/portal/src/components/Document/Code.tsx b/apps/portal/src/components/Document/Code.tsx index 5a3eea96788..82c18c70f40 100644 --- a/apps/portal/src/components/Document/Code.tsx +++ b/apps/portal/src/components/Document/Code.tsx @@ -73,8 +73,8 @@ export async function CodeBlock(props: { lang={lang} > diff --git a/apps/portal/src/components/Document/DocLink.tsx b/apps/portal/src/components/Document/DocLink.tsx index f7a402c9861..23359d691da 100644 --- a/apps/portal/src/components/Document/DocLink.tsx +++ b/apps/portal/src/components/Document/DocLink.tsx @@ -10,7 +10,7 @@ export function DocLink(props: { return ( diff --git a/apps/portal/src/components/Document/InlineCode.tsx b/apps/portal/src/components/Document/InlineCode.tsx index 163ce7c15a6..a4bb5bda43a 100644 --- a/apps/portal/src/components/Document/InlineCode.tsx +++ b/apps/portal/src/components/Document/InlineCode.tsx @@ -4,7 +4,7 @@ export function InlineCode(props: { code: string; className?: string }) { return ( -
-
- {props.editPageButton && } - {props.sidebarLinks && ( - - )} -
+