From 4e93893319b205851edfdaf9e699ec659119b484 Mon Sep 17 00:00:00 2001 From: Gib Date: Tue, 4 Mar 2025 23:58:53 -0600 Subject: [PATCH] Finish cleaning up theme stuff --- .vscode/settings.json | 7 ------ assets/fonts/SpaceMono-Regular.ttf | Bin components/theme/buttons/ThemedButton.tsx | 11 +++------- components/theme/buttons/ThemedTextButton.tsx | 9 ++++---- components/theme/inputs/ThemedSearchBar.tsx | 18 ++++++---------- components/theme/inputs/ThemedSwitch.tsx | 12 +++++------ components/theme/inputs/ThemedTextInput.tsx | 16 +++++--------- components/theme/ui/ThemedAvatar.tsx | 10 ++++----- components/theme/ui/ThemedBadge.tsx | 12 ++++------- components/theme/ui/ThemedCard.tsx | 6 +++--- components/theme/ui/ThemedDivider.tsx | 10 ++++----- components/theme/ui/ThemedIcon.tsx | 20 +++--------------- constants/Colors.ts | 8 +++---- scripts/reset-project.js | 0 14 files changed, 49 insertions(+), 90 deletions(-) delete mode 100644 .vscode/settings.json mode change 100755 => 100644 assets/fonts/SpaceMono-Regular.ttf mode change 100755 => 100644 scripts/reset-project.js diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index e2798e4..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "editor.codeActionsOnSave": { - "source.fixAll": "explicit", - "source.organizeImports": "explicit", - "source.sortMembers": "explicit" - } -} diff --git a/assets/fonts/SpaceMono-Regular.ttf b/assets/fonts/SpaceMono-Regular.ttf old mode 100755 new mode 100644 diff --git a/components/theme/buttons/ThemedButton.tsx b/components/theme/buttons/ThemedButton.tsx index fc72cbf..3931666 100644 --- a/components/theme/buttons/ThemedButton.tsx +++ b/components/theme/buttons/ThemedButton.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { StyleSheet, Pressable, PressableProps } from 'react-native'; -import { ThemedView } from '@/components/theme'; +import ThemedView from '@/components/theme/default/ThemedView'; import { Colors } from '@/constants/Colors'; import { useColorScheme } from '@/hooks/useColorScheme'; @@ -24,7 +24,7 @@ const ThemedButton: React.FC = ({ ...restProps // This now includes onPress automatically }) => { const scheme = useColorScheme() ?? 'dark'; - + return ( = ({ ]} > {children} diff --git a/components/theme/buttons/ThemedTextButton.tsx b/components/theme/buttons/ThemedTextButton.tsx index 8c1e1cb..02ffd32 100644 --- a/components/theme/buttons/ThemedTextButton.tsx +++ b/components/theme/buttons/ThemedTextButton.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { TextStyle, PressableProps } from 'react-native'; -import { ThemedButton, ThemedText } from '@/components/theme'; +import ThemedButton from '@/components/theme/buttons/ThemedButton'; +import ThemedText from '@/components/theme/default/ThemedText'; import { Colors } from '@/constants/Colors'; import { useColorScheme } from '@/hooks/useColorScheme'; @@ -28,10 +29,10 @@ const ThemedTextButton: React.FC = ({ ...restProps // This includes onPress and all other Pressable props }) => { const scheme = useColorScheme() ?? 'dark'; - + return ( - = ({ ...restProps }) => { const scheme = useColorScheme() ?? 'dark'; - + return ( - - + + = ({ width={width} style={styles.input} /> - + ); }; diff --git a/components/theme/inputs/ThemedSwitch.tsx b/components/theme/inputs/ThemedSwitch.tsx index 90ed403..6047981 100644 --- a/components/theme/inputs/ThemedSwitch.tsx +++ b/components/theme/inputs/ThemedSwitch.tsx @@ -5,16 +5,14 @@ import { useColorScheme } from '@/hooks/useColorScheme'; type ThemedSwitchProps = SwitchProps; -const ThemedSwitch: React.FC = ({ - ...props -}) => { +const ThemedSwitch: React.FC = ({ ...props }) => { const scheme = useColorScheme() ?? 'dark'; - + return ( = ({ ...restProps }) => { const scheme = useColorScheme() ?? 'dark'; - + return ( - + = ({ }) => { const scheme = useColorScheme() ?? 'dark'; const border = borderColor || Colors[scheme].tint; - + // Get initials from name const getInitials = (name?: string) => { if (!name) return ''; return name .split(' ') - .map(part => part[0]) + .map((part) => part[0]) .join('') .toUpperCase() .substring(0, 2); }; - + const initials = getInitials(name); - + return ( = ({ const scheme = useColorScheme() ?? 'dark'; const badgeColor = color || Colors[scheme].tint; const badgeTextColor = textColor || Colors[scheme].background; - + return ( = ({ ]} {...restProps} > - + {value} diff --git a/components/theme/ui/ThemedCard.tsx b/components/theme/ui/ThemedCard.tsx index 06e733d..8a8c995 100644 --- a/components/theme/ui/ThemedCard.tsx +++ b/components/theme/ui/ThemedCard.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { StyleSheet, ViewProps, Platform, DimensionValue } from 'react-native'; -import { ThemedView } from '@/components/theme'; +import ThemedView from '@/components/theme/default/ThemedView'; import { Colors } from '@/constants/Colors'; import { useColorScheme } from '@/hooks/useColorScheme'; @@ -23,7 +23,7 @@ const ThemedCard: React.FC = ({ ...restProps }) => { const scheme = useColorScheme() ?? 'dark'; - + return ( = ({ ...Platform.select({ ios: { shadowColor: Colors[scheme].text, - shadowOffset: { width: 0, height: elevation/2 }, + shadowOffset: { width: 0, height: elevation / 2 }, shadowOpacity: 0.1, shadowRadius: elevation, }, diff --git a/components/theme/ui/ThemedDivider.tsx b/components/theme/ui/ThemedDivider.tsx index 8d30ce4..a3484ce 100644 --- a/components/theme/ui/ThemedDivider.tsx +++ b/components/theme/ui/ThemedDivider.tsx @@ -5,8 +5,8 @@ import { useColorScheme } from '@/hooks/useColorScheme'; type ThemedDividerProps = ViewProps & { orientation?: 'horizontal' | 'vertical'; - thickness?: DimensionValue - length?: DimensionValue + thickness?: DimensionValue; + length?: DimensionValue; color?: string; }; @@ -19,12 +19,12 @@ const ThemedDivider: React.FC = ({ }) => { const scheme = useColorScheme() ?? 'dark'; const color = restProps.color || Colors[scheme].border; - + return ( = ({ - name, - size = 24, - color, - style, - ...restProps -}) => { +const ThemedIcon: React.FC = ({ name, size = 24, color, style, ...restProps }) => { const scheme = useColorScheme() ?? 'dark'; const iconColor = color || Colors[scheme].text; - - return ( - - ); + + return ; }; export default ThemedIcon; diff --git a/constants/Colors.ts b/constants/Colors.ts index 2c09e6d..dac3b91 100644 --- a/constants/Colors.ts +++ b/constants/Colors.ts @@ -16,7 +16,7 @@ export const Colors = { icon: iconColorLight, tabIconDefault: iconColorLight, tabIconSelected: tintColorLight, - + // New colors card: '#ffffff', border: '#d0d7de', @@ -26,7 +26,7 @@ export const Colors = { subtle: '#f6f8fa', error: '#e5484d', success: '#46954a', - warning: '#daaa3f' + warning: '#daaa3f', }, dark: { text: light, @@ -35,7 +35,7 @@ export const Colors = { icon: iconColorDark, tabIconDefault: iconColorDark, tabIconSelected: tintColorDark, - + // New colors card: '#3a3b4a', border: '#444c56', @@ -45,6 +45,6 @@ export const Colors = { subtle: '#272934', error: '#ff6369', success: '#3fb950', - warning: '#d29922' + warning: '#d29922', }, }; diff --git a/scripts/reset-project.js b/scripts/reset-project.js old mode 100755 new mode 100644