feat: Implement a settings screen for server connection configuration and theme preferences, supported by new color definitions.
This commit is contained in:
1 parent
0297db110a
commit
5fd7f7d2ed
2 files changed
+17
-17
No files matched your search
@@ -37,7 +37,7 @@ export default function SettingsScreen() {
|
|||||||
const [testResult, setTestResult] = useState<boolean | null>(null);
|
const [testResult, setTestResult] = useState<boolean | null>(null);
|
||||||
|
|
||||||
const isLargeScreen = width > 768;
|
const isLargeScreen = width > 768;
|
||||||
const isDarkMode = themePreference === 'dark' || (themePreference === 'system' && colors.backgroundColor === '#020617'); // Hacky check but robust given our Colors.ts
|
const isDarkMode = themePreference === 'dark' || (themePreference === 'system' && colors.backgroundColor === '#09090B'); // Hacky check but robust given our Colors.ts
|
||||||
const toggleTheme = () => setTheme(isDarkMode ? 'light' : 'dark');
|
const toggleTheme = () => setTheme(isDarkMode ? 'light' : 'dark');
|
||||||
|
|
||||||
const currentConfig: ServerConfig = {
|
const currentConfig: ServerConfig = {
|
||||||
@@ -174,8 +174,8 @@ export default function SettingsScreen() {
|
|||||||
{ color: testResult ? colors.successText : colors.errorText }
|
{ color: testResult ? colors.successText : colors.errorText }
|
||||||
]}>
|
]}>
|
||||||
{testResult
|
{testResult
|
||||||
? '✅ Connected successfully! API is ready.'
|
? 'Connection successful. API is ready.'
|
||||||
: '❌ Connection failed. Check host, port, and ensure LM Studio is running.'}
|
: 'Connection failed. Verify host and port.'}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+14
-14
@@ -1,5 +1,5 @@
|
|||||||
const tintColorLight = '#0F172A'; // slate-900
|
const tintColorLight = '#0F172A'; // slate-900
|
||||||
const tintColorDark = '#F8FAFC'; // slate-50
|
const tintColorDark = '#FAFAFA'; // zinc-50
|
||||||
|
|
||||||
export const Colors = {
|
export const Colors = {
|
||||||
light: {
|
light: {
|
||||||
@@ -28,22 +28,22 @@ export const Colors = {
|
|||||||
shadow: '#000000',
|
shadow: '#000000',
|
||||||
},
|
},
|
||||||
dark: {
|
dark: {
|
||||||
backgroundColor: '#020617', // slate-950
|
backgroundColor: '#09090B', // zinc-950
|
||||||
cardBackground: '#0F172A', // slate-900
|
cardBackground: '#18181B', // zinc-900
|
||||||
text: '#F8FAFC', // slate-50
|
text: '#FAFAFA', // zinc-50
|
||||||
textMuted: '#94A3B8', // slate-400
|
textMuted: '#A1A1AA', // zinc-400
|
||||||
border: '#1E293B', // slate-800
|
border: '#27272A', // zinc-800
|
||||||
tint: tintColorDark,
|
tint: tintColorDark,
|
||||||
icon: '#94A3B8',
|
icon: '#A1A1AA',
|
||||||
tabIconDefault: '#475569',
|
tabIconDefault: '#52525B', // zinc-600
|
||||||
tabIconSelected: tintColorDark,
|
tabIconSelected: tintColorDark,
|
||||||
// Chat specific
|
// Chat specific
|
||||||
messageUserText: '#020617', // slate-950
|
messageUserText: '#09090B', // zinc-950
|
||||||
messageUserBg: '#F8FAFC', // slate-50
|
messageUserBg: '#FAFAFA', // zinc-50
|
||||||
messageAssistantText: '#E2E8F0', // slate-200
|
messageAssistantText: '#F4F4F5', // zinc-100
|
||||||
messageAssistantBg: '#0F172A', // slate-900
|
messageAssistantBg: '#18181B', // zinc-900
|
||||||
inputBg: '#0F172A', // slate-900
|
inputBg: '#18181B', // zinc-900
|
||||||
inputBorder: '#1E293B', // slate-800
|
inputBorder: '#27272A', // zinc-800
|
||||||
bannerBg: '#451A03', // amber-950
|
bannerBg: '#451A03', // amber-950
|
||||||
bannerText: '#FDE68A', // amber-200
|
bannerText: '#FDE68A', // amber-200
|
||||||
successBg: '#052E16', // green-950
|
successBg: '#052E16', // green-950
|
||||||
|
|||||||
Reference in new issue
Block a user