Skip to content

Commit 58cd307

Browse files
committed
Restyle YouTube search form
1 parent aa74ab9 commit 58cd307

1 file changed

Lines changed: 25 additions & 13 deletions

File tree

src/app/youtube/youtube-content.tsx

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { useCallback, useEffect, useState } from 'react';
99
import Link from 'next/link';
1010
import { MainLayout } from '@/components/layout';
11+
import { LoadingSpinner, SearchIcon } from '@/components/ui/icons';
1112

1213
interface PublicYouTubeAccount {
1314
id: string;
@@ -106,7 +107,7 @@ export function YouTubeContent(): React.ReactElement {
106107
{accounts && accounts.length > 1 ? <select
107108
value={activeAccountId ?? ''}
108109
onChange={(e) => setActiveAccountId(e.target.value)}
109-
className="rounded border border-border bg-background px-2 py-1 text-sm"
110+
className="rounded-lg border border-border-default bg-bg-secondary px-4 py-2 text-sm text-text-primary focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
110111
>
111112
{accounts.map((a) => (
112113
<option key={a.id} value={a.id}>
@@ -117,7 +118,7 @@ export function YouTubeContent(): React.ReactElement {
117118
</select> : null}
118119
<Link
119120
href="/youtube/accounts"
120-
className="rounded border border-border px-3 py-1 text-sm hover:bg-accent"
121+
className="rounded-lg border border-border-default bg-bg-secondary px-4 py-2 text-sm text-text-primary transition-colors hover:bg-bg-hover"
121122
>
122123
Manage accounts
123124
</Link>
@@ -139,21 +140,32 @@ export function YouTubeContent(): React.ReactElement {
139140
and accept the YouTube permission prompt.
140141
</div> : null}
141142

142-
<form onSubmit={handleSearch} className="mb-6 flex gap-2">
143-
<input
144-
type="text"
145-
value={query}
146-
onChange={(e) => setQuery(e.target.value)}
147-
placeholder="Search YouTube…"
148-
className="flex-1 rounded border border-border bg-background px-3 py-2"
149-
disabled={noAccounts || needsReconnect}
150-
/>
143+
<form onSubmit={handleSearch} className="mb-6 flex flex-col gap-3 md:flex-row">
144+
<div className="relative flex-1">
145+
<div className="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-4">
146+
<SearchIcon className="text-text-muted" size={18} />
147+
</div>
148+
<input
149+
type="text"
150+
value={query}
151+
onChange={(e) => setQuery(e.target.value)}
152+
placeholder="Search YouTube…"
153+
className="w-full rounded-lg border border-border-default bg-bg-secondary py-3 pl-11 pr-4 text-sm text-text-primary placeholder:text-text-muted focus:border-accent-primary focus:outline-none focus:ring-1 focus:ring-accent-primary"
154+
disabled={noAccounts || needsReconnect}
155+
/>
156+
</div>
151157
<button
152158
type="submit"
153159
disabled={searching || noAccounts || needsReconnect}
154-
className="rounded bg-red-600 px-4 py-2 font-medium text-white hover:bg-red-700 disabled:opacity-50"
160+
className="flex items-center justify-center gap-2 rounded-lg bg-accent-primary px-5 py-3 text-sm font-medium text-white transition-colors hover:bg-accent-primary/90 disabled:cursor-not-allowed disabled:opacity-50 md:min-w-[140px]"
155161
>
156-
{searching ? 'Searching…' : 'Search'}
162+
{searching ? <>
163+
<LoadingSpinner className="text-white" size={18} />
164+
<span>Searching…</span>
165+
</> : <>
166+
<SearchIcon className="text-white" size={18} />
167+
<span>Search</span>
168+
</>}
157169
</button>
158170
</form>
159171

0 commit comments

Comments
 (0)