@@ -2,6 +2,7 @@ import { useState, useEffect } from "react";
2
2
import { invoke } from "@tauri-apps/api/core" ;
3
3
import { ask , message } from '@tauri-apps/plugin-dialog' ;
4
4
import { ShortcutItem } from "./ShortcutItem" ;
5
+ import { ThemeSelector } from "./ThemeSelector" ;
5
6
import { useShortcutEditor } from "../hooks/useShortcutEditor" ;
6
7
import { backendFormatToShortcut , shortcutToBackendFormat , Shortcut } from "../utils/keyboardUtils" ;
7
8
@@ -157,10 +158,10 @@ export function Settings() {
157
158
return (
158
159
< div className = "p-6 space-y-6" >
159
160
< div className = "animate-pulse" >
160
- < div className = "h-8 bg-slate-200 rounded w-1/3 mb-4" > </ div >
161
+ < div className = "h-8 bg-border-primary rounded w-1/3 mb-4" > </ div >
161
162
< div className = "space-y-3" >
162
163
{ [ ...Array ( 3 ) ] . map ( ( _ , i ) => (
163
- < div key = { i } className = "h-20 bg-slate-200 rounded" > </ div >
164
+ < div key = { i } className = "h-20 bg-border-primary rounded" > </ div >
164
165
) ) }
165
166
</ div >
166
167
</ div >
@@ -171,20 +172,20 @@ export function Settings() {
171
172
return (
172
173
< div className = "max-w-2xl mx-auto p-6 space-y-8" >
173
174
< div >
174
- < h1 className = "text-2xl text-slate-800 " > Settings</ h1 >
175
- < p className = "text-slate-600 mt-1" > Configure your Milo preferences</ p >
175
+ < h1 className = "text-2xl text-text-primary " > Settings</ h1 >
176
+ < p className = "text-text-secondary mt-1" > Configure your Milo preferences</ p >
176
177
</ div >
177
178
178
179
{ /* API Key Section */ }
179
- < div className = "bg-white p-6 rounded-lg border border-slate-200 " >
180
+ < div className = "bg-background-secondary p-6 rounded-lg border border-border-primary " >
180
181
< div className = "mb-4" >
181
- < h2 className = "text-lg text-slate-800 " > OpenAI API Configuration</ h2 >
182
- < p className = "text-sm text-slate-600 " > Configure your OpenAI API key for text transformations</ p >
182
+ < h2 className = "text-lg text-text-primary " > OpenAI API Configuration</ h2 >
183
+ < p className = "text-sm text-text-secondary " > Configure your OpenAI API key for text transformations</ p >
183
184
</ div >
184
185
185
186
< div className = "space-y-4" >
186
187
< div >
187
- < label htmlFor = "apiKey" className = "block text-sm text-slate-700 mb-2" >
188
+ < label htmlFor = "apiKey" className = "block text-sm text-text-primary mb-2" >
188
189
API Key
189
190
</ label >
190
191
< input
@@ -193,28 +194,38 @@ export function Settings() {
193
194
value = { apiKey }
194
195
onChange = { ( e ) => setApiKey ( e . target . value ) }
195
196
placeholder = "sk-..."
196
- className = "w-full px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 "
197
+ className = "w-full px-3 py-2 border border-border-primary rounded-lg focus:ring-2 focus:ring-accent-primary focus:border-accent-primary bg-background-primary text-text-primary "
197
198
/>
198
- < p className = "text-xs text-slate-500 mt-1" >
199
+ < p className = "text-xs text-text-tertiary mt-1" >
199
200
Your API key is stored securely on your device and never shared.
200
201
</ p >
201
202
</ div >
202
203
203
204
< button
204
205
onClick = { saveApiKey }
205
206
disabled = { saving || ! apiKey . trim ( ) }
206
- className = "px-3 py-2 text-sm bg-gray-100 text-gray-600 hover:bg-gray-200 rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
207
+ className = "px-3 py-2 text-sm bg-background-tertiary text-text-secondary hover:bg-border-primary rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
207
208
>
208
209
{ saving ? 'Saving...' : 'Save API Key' }
209
210
</ button >
210
211
</ div >
211
212
</ div >
212
213
214
+ { /* Theme Selection Section */ }
215
+ < div className = "bg-background-secondary p-6 rounded-lg border border-border-primary" >
216
+ < div className = "mb-4" >
217
+ < h2 className = "text-lg text-text-primary" > Appearance</ h2 >
218
+ < p className = "text-sm text-text-secondary" > Choose your preferred theme</ p >
219
+ </ div >
220
+
221
+ < ThemeSelector />
222
+ </ div >
223
+
213
224
{ /* Shortcut Configuration Section */ }
214
- < div className = "bg-white p-6 rounded-lg border border-slate-200 " >
225
+ < div className = "bg-background-secondary p-6 rounded-lg border border-border-primary " >
215
226
< div className = "mb-4" >
216
- < h2 className = "text-lg text-slate-800 " > Keyboard Shortcut</ h2 >
217
- < p className = "text-sm text-slate-600 " > Configure the global shortcut to transform clipboard text</ p >
227
+ < h2 className = "text-lg text-text-primary " > Keyboard Shortcut</ h2 >
228
+ < p className = "text-sm text-text-secondary " > Configure the global shortcut to transform clipboard text</ p >
218
229
</ div >
219
230
220
231
{ shortcut . length > 0 && (
@@ -234,21 +245,21 @@ export function Settings() {
234
245
</ div >
235
246
236
247
{ /* Data Management Section */ }
237
- < div className = "bg-white p-6 rounded-lg border border-slate-200 " >
248
+ < div className = "bg-background-secondary p-6 rounded-lg border border-border-primary " >
238
249
< div className = "mb-4" >
239
- < h2 className = "text-lg text-slate-800 " > Data Management</ h2 >
240
- < p className = "text-sm text-slate-600 " > Manage your transformation history and data</ p >
250
+ < h2 className = "text-lg text-text-primary " > Data Management</ h2 >
251
+ < p className = "text-sm text-text-secondary " > Manage your transformation history and data</ p >
241
252
</ div >
242
253
243
254
< div className = "space-y-4" >
244
255
< div className = "flex items-center justify-between" >
245
256
< div >
246
- < h3 className = "text-sm text-slate-800 " > Clear History</ h3 >
247
- < p className = "text-xs text-slate-600 " > Remove all transformation history permanently</ p >
257
+ < h3 className = "text-sm text-text-primary " > Clear History</ h3 >
258
+ < p className = "text-xs text-text-secondary " > Remove all transformation history permanently</ p >
248
259
</ div >
249
260
< button
250
261
onClick = { clearHistory }
251
- className = "px-3 py-2 text-sm bg-gray-100 text-gray-600 hover:bg-gray-200 rounded transition-colors"
262
+ className = "px-3 py-2 text-sm bg-background-tertiary text-text-secondary hover:bg-border-primary rounded transition-colors"
252
263
>
253
264
Clear All History
254
265
</ button >
0 commit comments