Skip to content

Commit

Permalink
[DASH-540] Nebula - Various UI improvements (#5777)
Browse files Browse the repository at this point in the history
## 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 -->
  • Loading branch information
MananTank authored and joaquim-verges committed Dec 17, 2024
1 parent 58bc4a9 commit b740f94
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shy-bats-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Validate getContract params
16 changes: 16 additions & 0 deletions packages/thirdweb/src/contract/contract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Abi } from "abitype";
import type { Chain } from "../chains/types.js";
import type { ThirdwebClient } from "../client/client.js";
import { isAddress } from "../utils/address.js";

/**
* @contract
Expand Down Expand Up @@ -42,5 +43,20 @@ export type ThirdwebContract<abi extends Abi = []> = Readonly<
export function getContract<const abi extends Abi = []>(
options: ContractOptions<abi>,
): ThirdwebContract<abi> {
if (!options.client) {
throw new Error(
`getContract validation error - invalid client: ${options.client}`,
);
}

Check warning on line 50 in packages/thirdweb/src/contract/contract.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/contract/contract.ts#L47-L50

Added lines #L47 - L50 were not covered by tests
if (!isAddress(options.address)) {
throw new Error(
`getContract validation error - invalid address: ${options.address}`,
);
}

Check warning on line 55 in packages/thirdweb/src/contract/contract.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/contract/contract.ts#L52-L55

Added lines #L52 - L55 were not covered by tests
if (!options.chain || !options.chain.id) {
throw new Error(
`getContract validation error - invalid chain: ${options.chain}`,
);
}

Check warning on line 60 in packages/thirdweb/src/contract/contract.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/contract/contract.ts#L57-L60

Added lines #L57 - L60 were not covered by tests
return options;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { beforeAll, describe, expect, it } from "vitest";
import { TEST_CLIENT } from "../../../test/src/test-clients.js";
import { arbitrumSepolia } from "../../chains/chain-definitions/arbitrum.js";
import { arbitrumSepolia } from "../../chains/chain-definitions/arbitrum-sepolia.js";
import { type ThirdwebContract, getContract } from "../../contract/contract.js";
import { balanceOf } from "../../extensions/erc1155/__generated__/IERC1155/read/balanceOf.js";
import { claimTo } from "../../extensions/erc1155/drops/write/claimTo.js";
Expand Down

0 comments on commit b740f94

Please sign in to comment.