Skip to content

Commit 4437af9

Browse files
committed
moar
1 parent f925482 commit 4437af9

File tree

5 files changed

+33
-26
lines changed

5 files changed

+33
-26
lines changed

apps/postgres-new/components/chat.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export function getInitialMessages(tables: TablesData): Message[] {
4848

4949
export default function Chat() {
5050
const { user, isLoadingUser } = useApp()
51+
const [inputFocusState, setInputFocusState] = useState(false)
5152

5253
const {
5354
databaseId,
@@ -343,7 +344,11 @@ export default function Chat() {
343344
)}
344345
</AnimatePresence>
345346
<form
346-
className="flex items-end py-2 px-3 rounded-[28px] bg-neutral-100 w-full max-w-4xl"
347+
className={cn(
348+
'flex py-2 px-3 rounded-[28px] bg-muted/50 border w-full max-w-4xl items-center gap-3',
349+
inputFocusState && 'border-muted-foreground',
350+
'transition'
351+
)}
347352
onSubmit={handleFormSubmit}
348353
>
349354
{/*
@@ -366,8 +371,10 @@ export default function Chat() {
366371
</m.div>
367372
)}
368373
<Button
369-
className="w-8 h-8 p-1.5 my-1 bg-inherit transition-colors"
370374
type="button"
375+
variant={'ghost'}
376+
className="w-8 h-8 text-muted-foreground hover:text-foreground focus:text-foreground"
377+
size="icon"
371378
onClick={(e) => {
372379
e.preventDefault()
373380

@@ -400,17 +407,23 @@ export default function Chat() {
400407
}}
401408
disabled={isLoading || !user}
402409
>
403-
<Paperclip size={20} />
410+
<Paperclip size={16} strokeWidth={1.3} />
404411
</Button>
405412
<textarea
406413
ref={inputRef}
407414
id="input"
408415
name="prompt"
409416
autoComplete="off"
410-
className="flex-grow border-none focus-visible:ring-0 text-base bg-inherit placeholder:text-neutral-400 resize-none"
417+
className="flex-grow border-none focus-visible:ring-0 text-base placeholder:text-muted-foreground/50 bg-transparent resize-none outline-none"
411418
value={input}
412419
onChange={handleInputChange}
413420
placeholder="Message AI or write SQL"
421+
onFocus={(e) => {
422+
setInputFocusState(true)
423+
}}
424+
onBlur={(e) => {
425+
setInputFocusState(false)
426+
}}
414427
autoFocus
415428
disabled={!user}
416429
rows={Math.min(input.split('\n').length, 10)}

apps/postgres-new/components/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function Layout({ children }: LayoutProps) {
3131
)}
3232

3333
{/* <main className="flex-1 flex flex-col"> */}
34-
{/* <Header /> */}
34+
<Header />
3535
<main className="flex-1 flex flex-col lg:flex-row min-h-0">
3636
{/* TODO: make sidebar available on mobile */}
3737
{!isSmallBreakpoint && <Sidebar />}

apps/postgres-new/components/schema/table-node.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function TableNode({ id, data, targetPosition, sourcePosition }: NodeProp
119119
itemHeight
120120
)}
121121
>
122-
<Table2 strokeWidth={1.3} size={21} className="text-secondary-foreground" />
122+
<Table2 strokeWidth={1.3} size={21} className="text-muted-foreground" />
123123

124124
{/* Animate the old title out and new title in */}
125125
<AnimatePresence mode="popLayout">

apps/postgres-new/components/sidebar.tsx

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default function Sidebar() {
6161
animate="show"
6262
exit={{ opacity: 0, transition: { duration: 0 } }}
6363
>
64-
<div className="flex justify-between text-neutral-500">
64+
<div className="flex justify-between">
6565
<Tooltip>
6666
<TooltipTrigger asChild>
6767
<m.div layout="position" layoutId="sidebar-collapse">
@@ -76,27 +76,21 @@ export default function Sidebar() {
7676
</Button>
7777
</m.div>
7878
</TooltipTrigger>
79-
<TooltipContent side="right" className="bg-black text-white">
79+
<TooltipContent side="right">
8080
<p>Close sidebar</p>
8181
</TooltipContent>
8282
</Tooltip>
83-
<Tooltip>
84-
<TooltipTrigger asChild>
85-
<m.div layout="position" layoutId="new-database-button">
86-
<Button
87-
size={'icon'}
88-
onClick={() => {
89-
router.push('/')
90-
}}
91-
>
92-
<PackagePlus size={14} />
93-
</Button>
94-
</m.div>
95-
</TooltipTrigger>
96-
<TooltipContent side="bottom" className="bg-black text-white">
97-
<p>New database</p>
98-
</TooltipContent>
99-
</Tooltip>
83+
<m.div layout="position" layoutId="new-database-button">
84+
<Button
85+
onClick={() => {
86+
router.push('/')
87+
}}
88+
className="gap-2"
89+
>
90+
<PackagePlus size={14} />
91+
New database
92+
</Button>
93+
</m.div>
10094
</div>
10195
{databases && databases.length > 0 ? (
10296
<m.div

apps/postgres-new/components/user-dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function UserDropdown() {
2222
<span className="sr-only">Toggle theme</span>
2323
</Button>
2424
</DropdownMenuTrigger>
25-
<DropdownMenuContent align="end">
25+
<DropdownMenuContent align="start" side="top">
2626
<DropdownMenuItem onClick={() => setTheme('light')}>Light</DropdownMenuItem>
2727
<DropdownMenuItem onClick={() => setTheme('dark')}>Dark</DropdownMenuItem>
2828
<DropdownMenuItem onClick={() => setTheme('system')}>System</DropdownMenuItem>

0 commit comments

Comments
 (0)