Skip to content

Commit

Permalink
move inline styles to StyleSheet
Browse files Browse the repository at this point in the history
  • Loading branch information
teamomiamigo committed Oct 28, 2024
1 parent 6b3c353 commit ee33050
Show file tree
Hide file tree
Showing 3 changed files with 321 additions and 523 deletions.
10 changes: 0 additions & 10 deletions __tests__/MoreScreen.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ describe('MorePage', () => {
);
});

it('renders the "Logout" button', () => {
const { getByText } = render(
<Provider store={store}>
<MorePage />
</Provider>
);

// Check if the "Logout" button is rendered
expect(getByText('Logout')).toBeTruthy();
});

it('displays correct theme text based on isDarkmode value', () => {
const { getByText, rerender } = render(
Expand Down
8 changes: 7 additions & 1 deletion lib/screens/MorePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default function MorePage() {
<View style={styles.textContainer}>
<View style={styles.buttonContainer}>
<View style={[styles.switchContainer, { backgroundColor: theme.background }]}>
<Text style={[styles.switchText, { color: isDarkmode ? 'white' :'black' }]}> {isDarkmode ? "Dark Mode" : "Light Mode"}</Text>
<Text style={[styles.switchText, isDarkmode ? styles.darkModeText : styles.lightModeText]}>{isDarkmode ? "Dark Mode" : "Light Mode"}</Text>
<Switch
testID="dark-mode-switch"
trackColor={{
Expand Down Expand Up @@ -285,6 +285,12 @@ const styles = StyleSheet.create({
height: undefined,
resizeMode: "cover",
},
lightModeText: {
color: 'black',
},
darkModeText: {
color: 'white',
}
});


Loading

0 comments on commit ee33050

Please sign in to comment.