Skip to content

Commit 5605148

Browse files
committed
chore: design things
1 parent 1271f8a commit 5605148

6 files changed

Lines changed: 26 additions & 23 deletions

File tree

examples/ai-conference-assistant/src/components/app-settings-bar.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
'use client'
22

33
import { useTheme } from 'next-themes'
4+
import { useSyncExternalStore } from 'react'
45
import type { Locale } from '@/i18n/dictionaries'
56
import { useI18n } from '@/i18n/context'
67

8+
/** True only after client hydration so theme toggle active styles match server HTML (next-themes is undefined on server). */
9+
function useHydrated() {
10+
return useSyncExternalStore(
11+
() => () => {},
12+
() => true,
13+
() => false,
14+
)
15+
}
16+
717
export function AppSettingsBar({ className = '' }: { className?: string }) {
818
const { locale, setLocale, t } = useI18n()
919
const { theme, setTheme } = useTheme()
20+
const hydrated = useHydrated()
1021

1122
return (
1223
<div
@@ -21,7 +32,7 @@ export function AppSettingsBar({ className = '' }: { className?: string }) {
2132
type="button"
2233
onClick={() => setTheme(key)}
2334
className={`rounded-md px-2 py-1 text-xs font-medium transition ${
24-
theme === key
35+
hydrated && theme === key
2536
? 'bg-white text-zinc-900 shadow dark:bg-zinc-700 dark:text-zinc-100'
2637
: 'text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200'
2738
}`}

examples/ai-conference-assistant/src/components/chat-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export function ChatPanel({
206206
title={
207207
previewConfirmed ? t('chat.createNotesTitle') : t('chat.createNotesDisabledTitle')
208208
}
209-
className="rounded-lg bg-gradient-to-r from-emerald-600 to-teal-600 px-3 py-2 text-xs font-medium text-white shadow-sm transition hover:from-emerald-500 hover:to-teal-500 disabled:cursor-not-allowed disabled:opacity-50 sm:px-4 sm:text-sm"
209+
className="rounded-lg bg-emerald-600 px-3 py-2 text-xs font-medium text-white shadow-sm transition hover:bg-emerald-500 disabled:cursor-not-allowed disabled:opacity-50 sm:px-4 sm:text-sm"
210210
>
211211
🚀 {t('chat.createNotes', { count: generatedData.pages.length + 1 })}
212212
</button>
@@ -426,7 +426,7 @@ export function ChatPanel({
426426
<button
427427
type="submit"
428428
disabled={isLoading || !inputValue.trim()}
429-
className="shrink-0 rounded-xl bg-gradient-to-r from-blue-600 to-indigo-600 px-4 py-2.5 font-medium text-white shadow-sm transition hover:from-blue-500 hover:to-indigo-500 disabled:cursor-not-allowed disabled:opacity-50 sm:px-6"
429+
className="shrink-0 rounded-xl bg-blue-600 px-4 py-2.5 font-medium text-white shadow-sm transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50 sm:px-6"
430430
>
431431
{t('common.send')}
432432
</button>

examples/ai-conference-assistant/src/components/preview-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function PreviewPanel({
100100
type="button"
101101
onClick={onCreateNotes}
102102
disabled={!previewConfirmed}
103-
className="w-full rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 py-3 text-sm font-medium text-white shadow-md shadow-emerald-600/20 transition hover:from-emerald-500 hover:to-teal-500 disabled:cursor-not-allowed disabled:opacity-50 dark:shadow-emerald-900/30"
103+
className="w-full rounded-xl bg-emerald-600 py-3 text-sm font-medium text-white shadow-sm transition hover:bg-emerald-500 disabled:cursor-not-allowed disabled:opacity-50"
104104
>
105105
{t('preview.createButton', { count: generatedData.pages.length + 1 })}
106106
</button>

examples/ai-conference-assistant/src/components/progress-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export function ProgressModal({ config, generatedData, onClose }: ProgressModalP
223223
<button
224224
type="button"
225225
onClick={startCreation}
226-
className="rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 px-6 py-3 font-medium text-white shadow-md transition hover:from-emerald-500 hover:to-teal-500"
226+
className="rounded-xl bg-emerald-600 px-6 py-3 font-medium text-white shadow-sm transition hover:bg-emerald-500"
227227
>
228228
🚀 {t('progress.startButton')}
229229
</button>

examples/ai-conference-assistant/src/components/setup-panel.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,15 @@ export function SetupPanel({ onConfigured }: SetupPanelProps) {
4848
}
4949

5050
return (
51-
<div className="relative min-h-screen overflow-hidden bg-gradient-to-br from-sky-50 via-white to-indigo-100 dark:from-zinc-950 dark:via-zinc-900 dark:to-indigo-950">
52-
<div className="pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_at_top,_rgba(56,189,248,0.12),_transparent_55%)] dark:bg-[radial-gradient(ellipse_at_top,_rgba(59,130,246,0.12),_transparent_55%)]" />
53-
<div className="pointer-events-none absolute -right-24 -top-24 h-72 w-72 rounded-full bg-indigo-400/15 blur-3xl dark:bg-indigo-500/10" />
54-
<div className="pointer-events-none absolute -bottom-20 -left-16 h-64 w-64 rounded-full bg-sky-300/20 blur-3xl dark:bg-sky-500/10" />
55-
51+
<div className="relative min-h-screen bg-zinc-50 dark:bg-zinc-950">
5652
<div className="absolute right-4 top-4 z-10 sm:right-6 sm:top-6">
5753
<AppSettingsBar />
5854
</div>
5955

6056
<div className="relative flex min-h-screen items-center justify-center p-4">
61-
<div className="w-full max-w-lg rounded-2xl border border-zinc-200/80 bg-white/90 p-8 shadow-xl shadow-zinc-900/5 backdrop-blur dark:border-zinc-700/80 dark:bg-zinc-900/85 dark:shadow-black/40">
57+
<div className="w-full max-w-lg rounded-2xl border border-zinc-200 bg-white p-8 shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
6258
<div className="mb-8 text-center">
63-
<div className="mb-3 inline-flex h-12 w-12 items-center justify-center rounded-2xl bg-gradient-to-br from-sky-500 to-indigo-600 text-2xl shadow-lg shadow-indigo-500/25">
59+
<div className="mb-3 inline-flex h-12 w-12 items-center justify-center rounded-2xl border border-zinc-200 bg-zinc-100 text-2xl dark:border-zinc-600 dark:bg-zinc-800">
6460
📚
6561
</div>
6662
<h1 className="text-2xl font-bold tracking-tight text-zinc-900 dark:text-zinc-50 sm:text-3xl">
@@ -149,7 +145,7 @@ export function SetupPanel({ onConfigured }: SetupPanelProps) {
149145
<button
150146
type="submit"
151147
disabled={verifying || !apiKey}
152-
className="w-full rounded-xl bg-gradient-to-r from-blue-600 to-indigo-600 py-3 font-medium text-white shadow-md shadow-blue-600/25 transition hover:from-blue-500 hover:to-indigo-500 disabled:cursor-not-allowed disabled:opacity-50 dark:shadow-indigo-900/40"
148+
className="w-full rounded-xl bg-blue-600 py-3 font-medium text-white shadow-sm transition hover:bg-blue-500 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-blue-600 dark:hover:bg-blue-500"
153149
>
154150
{verifying ? t('common.verifying') : t('setup.start')}
155151
</button>

examples/ai-conference-assistant/src/i18n/dictionaries.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@ export const en = {
6464
invalidJson: 'Invalid JSON file. Please upload a valid JSON file.',
6565
},
6666
preview: {
67-
empty:
68-
'After the assistant runs generate_preview_pages, homepage and session pages appear here. Session data is analyzed with session_jq on the server — nothing huge is pasted in chat.',
69-
panelTitle: 'Preview (book mode)',
67+
empty: 'No preview yet.',
68+
panelTitle: 'Preview',
7069
homepage: 'Homepage',
7170
morePages: '+{count} more',
72-
confirmLabel:
73-
'I confirm this preview matches what I want on HackMD. Real notes are created only after I click the button below.',
71+
confirmLabel: 'I confirm this preview before creating notes on HackMD.',
7472
createButton: 'Create {count} notes on HackMD',
7573
},
7674
progress: {
@@ -160,13 +158,11 @@ export const zhTW: Messages = {
160158
invalidJson: '不是有效的 JSON 檔案,請上傳正確的 JSON。',
161159
},
162160
preview: {
163-
empty:
164-
'助理執行 generate_preview_pages 後,首頁與各場次頁會顯示在此。場次資料在伺服器上以 session_jq 分析 — 不會在聊天貼一大段 JSON。',
165-
panelTitle: '預覽(書籍模式)',
161+
empty: '尚無預覽。',
162+
panelTitle: '預覽',
166163
homepage: '首頁',
167164
morePages: '另有 {count} 頁',
168-
confirmLabel:
169-
'我確認此預覽符合我要在 HackMD 上建立的內容。只有在我按下下方按鈕後才會真正建立筆記。',
165+
confirmLabel: '確認此預覽後,再在 HackMD 建立筆記。',
170166
createButton: '在 HackMD 建立 {count} 則筆記',
171167
},
172168
progress: {

0 commit comments

Comments
 (0)