Skip to content

Commit

Permalink
Extract settings styles to remove require cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
mhoran committed Apr 12, 2024
1 parent 8146a8d commit 27b09f4
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/usecase/login/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ConnectedProps, connect } from 'react-redux';
import { ConnectionError } from '../../lib/weechat/connection';
import { StoreState } from '../../store';
import UndoTextInput from '../shared/UndoTextInput';
import { styles } from '../settings/SettingsNavigator';
import { styles } from '../settings/styles';
import { setConnectionInfoAction } from '../../store/actions';

const connector = connect((state: StoreState) => ({
Expand Down
47 changes: 0 additions & 47 deletions src/usecase/settings/SettingsNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useState } from 'react';
import { StyleSheet } from 'react-native';
import { ConnectionError } from '../../lib/weechat/connection';
import LoginForm from '../login/LoginForm';
import UploadSettings from './UploadSettings';
Expand Down Expand Up @@ -35,49 +34,3 @@ const SettingsNavigator: React.FC<Props> = ({
};

export default SettingsNavigator;

export const styles = StyleSheet.create({
container: {
backgroundColor: '#f8f8f8',
flex: 1,
padding: 20
},
header: {
textAlign: 'center',
color: '#4157af',
fontSize: 20
},
text: {
padding: 10,
color: '#4157af',
fontSize: 18
},
input: {
marginVertical: 10,
padding: 10,
borderBottomWidth: 2,
fontSize: 18,
borderColor: '#4157af',
color: '#4157af'
},
centeredButton: {
flexDirection: 'row',
justifyContent: 'center'
},
button: {
borderWidth: 2,
borderColor: '#4157af',
width: 200,
backgroundColor: '#f8f8f8',
paddingHorizontal: 20,
paddingVertical: 10,
borderRadius: 20
},
buttonText: {
textAlign: 'center',
color: '#4157af',
fontWeight: '400',
fontSize: 18,
textTransform: 'uppercase'
}
});
2 changes: 1 addition & 1 deletion src/usecase/settings/UploadSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { SafeAreaView } from 'react-native-safe-area-context';
import { ConnectedProps, connect } from 'react-redux';
import { StoreState } from '../../store';
import UndoTextInput from '../shared/UndoTextInput';
import { styles } from './SettingsNavigator';
import { styles } from './styles';
import { setMediaUploadOptionsAction } from '../../store/actions';

const connector = connect((state: StoreState) => ({
Expand Down
47 changes: 47 additions & 0 deletions src/usecase/settings/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { StyleSheet } from 'react-native';

export const styles = StyleSheet.create({
container: {
backgroundColor: '#f8f8f8',
flex: 1,
padding: 20
},
header: {
textAlign: 'center',
color: '#4157af',
fontSize: 20
},
text: {
padding: 10,
color: '#4157af',
fontSize: 18
},
input: {
marginVertical: 10,
padding: 10,
borderBottomWidth: 2,
fontSize: 18,
borderColor: '#4157af',
color: '#4157af'
},
centeredButton: {
flexDirection: 'row',
justifyContent: 'center'
},
button: {
borderWidth: 2,
borderColor: '#4157af',
width: 200,
backgroundColor: '#f8f8f8',
paddingHorizontal: 20,
paddingVertical: 10,
borderRadius: 20
},
buttonText: {
textAlign: 'center',
color: '#4157af',
fontWeight: '400',
fontSize: 18,
textTransform: 'uppercase'
}
});

0 comments on commit 27b09f4

Please sign in to comment.