Skip to content

Commit b740f94

Browse files
MananTankjoaquim-verges
authored andcommitted
[DASH-540] Nebula - Various UI improvements (#5777)
## Problem solved DASH-540 * on the chat page -> move the container 1 level down - so the chat can be scrolled from the corner of the page as well * reduce container max-width for the history page to 800px to match it with landing page * stop the auto scroll if user interacts with chat UI * custom 404 page for the nebula subdomain * remove the announcement banner from the 404 pages ( this affects entire dashboard) * fix empty title in chat history page * fix overflow in chat history page on mobile when there's a long text without a whitespace <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the chat functionality and user experience in the `Nebula` application. It introduces auto-scrolling features, improves layout styling, and adds a new `404 Not Found` page. ### Detailed summary - Added auto-scrolling feature to `Chats` component. - Introduced `setEnableAutoScroll` function to manage scrolling behavior. - Enhanced styling in `ChatHistoryPage` and `SessionCard`. - Implemented a new `NebulaNotFound` component with a user-friendly 404 message. - Updated `ChatPageContent` to utilize the new auto-scroll functionality. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 58bc4a9 commit b740f94

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

.changeset/shy-bats-eat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Validate getContract params

packages/thirdweb/src/contract/contract.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Abi } from "abitype";
22
import type { Chain } from "../chains/types.js";
33
import type { ThirdwebClient } from "../client/client.js";
4+
import { isAddress } from "../utils/address.js";
45

56
/**
67
* @contract
@@ -42,5 +43,20 @@ export type ThirdwebContract<abi extends Abi = []> = Readonly<
4243
export function getContract<const abi extends Abi = []>(
4344
options: ContractOptions<abi>,
4445
): ThirdwebContract<abi> {
46+
if (!options.client) {
47+
throw new Error(
48+
`getContract validation error - invalid client: ${options.client}`,
49+
);
50+
}
51+
if (!isAddress(options.address)) {
52+
throw new Error(
53+
`getContract validation error - invalid address: ${options.address}`,
54+
);
55+
}
56+
if (!options.chain || !options.chain.id) {
57+
throw new Error(
58+
`getContract validation error - invalid chain: ${options.chain}`,
59+
);
60+
}
4561
return options;
4662
}

packages/thirdweb/src/wallets/smart/smart-wallet-dev.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { beforeAll, describe, expect, it } from "vitest";
22
import { TEST_CLIENT } from "../../../test/src/test-clients.js";
3-
import { arbitrumSepolia } from "../../chains/chain-definitions/arbitrum.js";
3+
import { arbitrumSepolia } from "../../chains/chain-definitions/arbitrum-sepolia.js";
44
import { type ThirdwebContract, getContract } from "../../contract/contract.js";
55
import { balanceOf } from "../../extensions/erc1155/__generated__/IERC1155/read/balanceOf.js";
66
import { claimTo } from "../../extensions/erc1155/drops/write/claimTo.js";

0 commit comments

Comments
 (0)