Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 46 additions & 52 deletions apps/portal/src/app/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function Header() {
const pathname = usePathname();

return (
<header className="flex w-full flex-col gap-2 border-b bg-background p-4 xl:pb-0 lg:px-8 overflow-hidden">
<header className="flex w-full flex-col gap-2 border-b p-4 xl:pb-0 lg:px-8 lg:pt-5 overflow-hidden bg-card">
{/* Top row */}
<div className="container flex items-center justify-between gap-6">
<div className="flex items-center gap-2">
Expand All @@ -230,7 +230,7 @@ export function Header() {
</Link>
</div>

<div className="flex items-center gap-3">
<div className="flex items-center gap-4">
<div className="hidden xl:block">
<Link
className="text-foreground"
Expand Down Expand Up @@ -269,13 +269,13 @@ export function Header() {
</div>

{/* Bottom row - hidden on mobile */}
<div className="container hidden items-center justify-between gap-6 xl:flex mt-1">
<div className="container hidden items-start justify-between gap-6 xl:flex mt-1">
<nav className="flex grow gap-5">
<ul className="flex flex-row items-center gap-0 mb-1">
<ul className="flex flex-row items-center gap-0 mb-1.5">
{links.map((link) => {
return (
<li
className="flex items-center py-2 relative px-2.5 hover:text-foreground"
className="flex items-center relative"
key={link.href}
onClick={() => {
setShowBurgerMenu(false);
Expand All @@ -284,57 +284,51 @@ export function Header() {
setShowBurgerMenu(false);
}}
>
<NavLink href={link.href} name={link.name} />
<NavLink
href={link.href}
name={link.name}
className="py-2.5 px-3 hover:bg-accent rounded-lg hover:text-foreground font-normal"
/>
{pathname?.startsWith(link.href) && (
<div className="bg-violet-700 h-[2px] inset-x-0 rounded-full absolute -bottom-1" />
<div className="bg-foreground h-[2px] inset-x-0 rounded-full absolute -bottom-1.5" />
)}
</li>
);
})}
</ul>
</nav>

<div className="flex items-center gap-3">
<div className="px-1">
<DropdownLinks
category="AI"
links={aiLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>
</div>
<div className="px-1">
<DropdownLinks
category="SDKs"
links={sdkLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>
</div>
<div className="px-1">
<DropdownLinks
category="APIs"
links={apisLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>
</div>

<div className="px-1">
<DropdownLinks
category="Tools"
links={toolLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>
</div>
<div className="flex items-center">
<DropdownLinks
category="AI"
links={aiLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>
<DropdownLinks
category="SDKs"
links={sdkLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>
<DropdownLinks
category="APIs"
links={apisLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>

<div className="px-1">
<DropdownLinks
category="Support"
links={supportLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>
</div>
<DropdownLinks
category="Tools"
links={toolLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>
<DropdownLinks
category="Support"
links={supportLinks}
onLinkClick={() => setShowBurgerMenu(false)}
/>

<NavLink
href="/changelog"
className="px-3 py-2.5 hover:bg-accent hover:text-foreground rounded-lg"
name="Changelog"
onClick={() => {
setShowBurgerMenu(false);
Expand Down Expand Up @@ -448,31 +442,29 @@ function DropdownLinks(props: {
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
className="inline-flex items-center gap-1 p-0 font-medium text-muted-foreground text-sm hover:bg-transparent hover:text-foreground"
className="inline-flex items-center gap-1.5 font-normal text-muted-foreground text-sm hover:bg-accent hover:text-foreground rounded-lg px-3 py-2.5"
variant="ghost"
>
{props.category}
<ChevronDownIcon className="size-4 text-muted-foreground opacity-70" />
<ChevronDownIcon className="size-3.5 text-muted-foreground opacity-70" />
</Button>
</DropdownMenuTrigger>

<DropdownMenuContent
className="flex flex-col gap-1 bg-card p-3"
style={{
minWidth: "150px",
}}
className="flex flex-col gap-1 bg-card p-1 rounded-xl min-w-[200px]"
sideOffset={14}
>
{props.links.map((info) => {
return (
<DropdownMenuItem asChild key={info.name}>
<div
className={clsx(
"relative flex cursor-pointer gap-2 font-medium text-foreground",
"relative flex cursor-pointer gap-3 font-medium text-foreground !rounded-lg px-3 py-2",
"hover:bg-accent",
)}
>
{info.icon && (
<info.icon className="size-5 text-foreground" />
<info.icon className="size-5 text-muted-foreground" />
)}
<Link
className="before:absolute before:inset-0"
Expand Down Expand Up @@ -524,6 +516,7 @@ function NavLink(props: {
name: string;
onClick?: () => void;
icon?: React.FC<{ className?: string }>;
className?: string;
}) {
const pathname = usePathname();
return (
Expand All @@ -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}
Expand Down
86 changes: 43 additions & 43 deletions apps/portal/src/app/transactions/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<OpenApiEndpoint path="/v1/transactions" method="POST" />
<OpenApiEndpoint path="/v1/transactions" method="POST" />

</TabsContent>
</TabsContent>

<TabsContent value="typescript">
### Installation
Expand Down Expand Up @@ -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);
}
}
}
```

</TabsContent>

Expand Down
2 changes: 2 additions & 0 deletions apps/portal/src/app/transactions/sponsor/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ Example sponsored contract write request:

</Tabs>

<div className='h-6' />

That's it! All transactions executed by the user will be sponsored via the thirdweb infrastructure.

</TabsContent>
Expand Down
6 changes: 3 additions & 3 deletions apps/portal/src/components/AI/chat-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ export function ChatButton() {
<>
{/* Inline Button (not floating) */}
<Button
className="gap-2 rounded-full shadow-lg"
className="gap-2 rounded-full bg-background"
onClick={() => {
setIsOpen(true);
setHasBeenOpened(true);
}}
variant="default"
variant="outline"
>
<MessageCircleIcon className="size-4" />
<MessageCircleIcon className="size-4 text-muted-foreground" />
Ask AI
</Button>

Expand Down
16 changes: 8 additions & 8 deletions apps/portal/src/components/Document/AuthMethodsTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -849,25 +850,24 @@ function AuthMethodsTabsContent() {
</h3>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3">
{authMethods.map((method) => (
<button
<Button
type="button"
variant="outline"
key={method.id}
onClick={() => setSelectedAuth(method.id)}
className={cn(
"overflow-hidden text-ellipsis px-3 py-1.5 transition-colors duration-300 hover:text-foreground text-sm rounded-lg hover:bg-violet-800/15",
selectedAuth === method.id
? "font-medium text-foreground bg-violet-800/25 border border-violet-800"
: "",
"flex flex-row justify-start items-start gap-3",
"overflow-hidden text-ellipsis text-sm rounded-lg hover:bg-accent justify-start gap-3 h-auto py-3 rounded-xl",
selectedAuth === method.id &&
"font-medium text-foreground bg-accent",
)}
>
<img
alt={method.label}
className="size-5 shrink-0"
src={getSocialIcon(method.id)}
/>
<div className="font-medium">{method.label}</div>
</button>
<div>{method.label}</div>
</Button>
))}
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/Document/Code.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export async function CodeBlock(props: {
lang={lang}
>
<ScrollShadow
className=""
scrollableClassName={cn("p-4", props.scrollContainerClassName)}
shadowColor="hsl(var(--card))"
>
<RenderCode code={code} lang={lang} tokenLinks={tokenLinks} />
</ScrollShadow>
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/Document/DocLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function DocLink(props: {
return (
<Link
className={cn(
"underline decoration-violet-800 decoration-dotted underline-offset-[5px] transition-colors hover:decoration-violet-800 hover:decoration-solid hover:text-foreground",
"text-blue-600 hover:text-blue-700 dark:text-blue-500 dark:hover:text-blue-400 decoration-dotted transition-colors ",
props.className,
)}
href={props.href}
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/Document/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function Grid(props: { children: React.ReactNode; className?: string }) {
return (
<div
className={cn(
"my-4 grid gap-4 md:grid-cols-2 lg:grid-cols-3",
"my-4 grid gap-3 md:grid-cols-2 lg:grid-cols-3",
props.className,
)}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/components/Document/InlineCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function InlineCode(props: { code: string; className?: string }) {
return (
<code
className={cn(
"max-h-20 rounded-md border bg-muted px-1.5 py-0.5 text-[0.875em]",
"max-h-20 rounded-lg bg-muted border px-1.5 py-[3px] text-[0.875em]",
props.className,
)}
style={{
Expand Down
Loading
Loading