Skip to content

Commit

Permalink
[Dashboard] Minor UI adjustments (#5705)
Browse files Browse the repository at this point in the history
Fixes: DASH-604, DASH-582

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on improving the functionality and UI of the `ChatBar`, modifying the `PublishedContractTable`, and disabling the invite button in the `InviteSection`.

### Detailed summary
- In `ChatBar.tsx`, added a condition to ignore the `Enter` key if the `Shift` key is pressed.
- In `PublishedContractTable.tsx`, changed the `span` to have a maximum width and normal whitespace handling.
- In `InviteSection.tsx`, set `inviteEnabled` to `false` and disabled the invite button.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
MananTank committed Dec 11, 2024
1 parent 196f677 commit a0fabb2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function PublishedContractTable(props: PublishedContractTableProps) {
accessor: (row) => row.description,
// biome-ignore lint/suspicious/noExplicitAny: FIXME
Cell: (cell: any) => (
<span className="line-clamp-2 text-muted-foreground">
<span className="line-clamp-2 max-w-[350px] whitespace-normal text-muted-foreground">
{cell.value}
</span>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export function Chatbar(props: {
value={message}
onChange={(e) => setMessage(e.target.value)}
onKeyDown={(e) => {
// ignore if shift key is pressed to allow entering new lines
if (e.shiftKey) {
return;
}
if (e.key === "Enter" && !props.isChatStreaming) {
setMessage("");
props.sendMessage(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function InviteSection(props: {
}) {
const teamPlan = getValidTeamPlan(props.team);
let bottomSection: React.ReactNode = null;
const inviteEnabled = teamPlan !== "free" && props.userHasEditPermission;
const inviteEnabled = false; // teamPlan !== "free" && props.userHasEditPermission;

if (teamPlan === "free") {
bottomSection = (
Expand Down Expand Up @@ -62,7 +62,12 @@ export function InviteSection(props: {
} else {
bottomSection = (
<div className="flex items-center border-border border-t px-4 py-4 lg:justify-end lg:px-6">
<Button variant="outline" size="sm" className="gap-2 max-sm:w-full">
<Button
variant="outline"
size="sm"
className="gap-2 max-sm:w-full"
disabled
>
<UserPlus className="size-3" />
Invite
</Button>
Expand Down

0 comments on commit a0fabb2

Please sign in to comment.