Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed inline CSS #468

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions src/components/ButtonWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
Image,
ImageSourcePropType,
Pressable,
StyleSheet,
Text,
} from 'react-native';
import { styles } from '../styles/ButtonWidgetStyle';

interface IButtonWidget {
icon?: ImageSourcePropType;
Expand Down Expand Up @@ -37,7 +37,7 @@ const ButtonWidget = ({
return (
<Pressable style={icon ? styles.iconStyle : btnStyle} onPress={onPress}>
{icon ? (
<Image style={{ height: 50, width: 50 }} source={icon} />
<Image style={styles.imageStyle} source={icon} />
) : (
<Text
style={{
Expand All @@ -53,21 +53,4 @@ const ButtonWidget = ({
);
};

const styles = StyleSheet.create({
button: {
borderRadius: 10,
marginVertical: 4,
borderColor: '#16A334',
borderWidth: 1,
padding: 10,
elevation: 2,
color: 'white',
minWidth: '35%',
maxWidth: '100%',
},
iconStyle: {
borderRadius: 15,
},
});

export default ButtonWidget;
62 changes: 62 additions & 0 deletions src/components/CreateGoalForm/CreateGoalFormStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { StyleSheet } from "react-native";

export const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
border: '2px solid black',
padding: 30,
},
form: {
border: '2px solid black',
padding: 10,
borderRadius: 15,
},
paragraph: {
margin: 5,
fontSize: 18,
fontWeight: 'bold',
color: 'blue',
textAlign: 'center',
},
input: {
height: 30,
margin: 10,
borderWidth: 1,
padding: 10,
backgroundColor: '#ecf0f1',
fontSize: 12,
},
formchild: {
marginTop: 5,
fontWeight: 'bold',
},
toggle: {
display: 'flex',
flexDirection: 'row',
margin: 5,
padding: 3,
alignItems: 'center',
justifyContent: 'center',
},
togglechild: {
margin: 5,
},
button: {
backgroundColor: 'blue',
padding: 6,
marginTop: 12,
width: '40%',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 15,
},
buttoncontainer: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
buttonText:{
color: 'white'
}
});
62 changes: 2 additions & 60 deletions src/components/CreateGoalForm/CreateGoalform.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
Text,
View,
StyleSheet,
TextInput,
Switch,
TouchableOpacity,
} from 'react-native';
import React, { useState } from 'react';
import Deadline from './DatePicker';
import Dropdown from './Dropdown';
import { styles } from './CreateGoalFormStyle';

export default function CreateGoalform() {
const [title, onChangeTitle] = useState('');
Expand Down Expand Up @@ -66,68 +66,10 @@ export default function CreateGoalform() {

<View style={styles.buttoncontainer}>
<TouchableOpacity style={styles.button}>
<Text style={{ color: 'white' }}>Create</Text>
<Text style={styles.buttonText}>Create</Text>
</TouchableOpacity>
</View>
</View>
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
border: '2px solid black',
padding: 30,
},
form: {
border: '2px solid black',
padding: 10,
borderRadius: 15,
},
paragraph: {
margin: 5,
fontSize: 18,
fontWeight: 'bold',
color: 'blue',
textAlign: 'center',
},
input: {
height: 30,
margin: 10,
borderWidth: 1,
padding: 10,
backgroundColor: '#ecf0f1',
fontSize: 12,
},
formchild: {
marginTop: 5,
fontWeight: 'bold',
},
toggle: {
display: 'flex',
flexDirection: 'row',
margin: 5,
padding: 3,
alignItems: 'center',
justifyContent: 'center',
},
togglechild: {
margin: 5,
},
button: {
backgroundColor: 'blue',
padding: 6,
marginTop: 12,
width: '40%',
alignItems: 'center',
justifyContent: 'center',
borderRadius: 15,
},
buttoncontainer: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
});
27 changes: 27 additions & 0 deletions src/components/CreateGoalForm/DatePickerStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { StyleSheet } from "react-native";

export const styles = StyleSheet.create({
container: {
flex: 1,
padding: 8,
justifyContent: 'center',
alignItems: 'center',
},
datePickerStyle: {
height: 40,
border: '1px solid black',
width: 205,
marginTop: 2,
},
dateIconStyle:{
position: 'absolute',
left: 0,
top: 4,
marginLeft: 0,
},
dateInputStyle:{
marginLeft: 36,
height: 30,
border: 'none',
}
});
28 changes: 3 additions & 25 deletions src/components/CreateGoalForm/Dropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useState } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Text, View } from 'react-native';
import { SelectCountry } from 'react-native-element-dropdown';
import Searchbar from './SearchBar';
import Radio from './RadioGroup';
import { styles } from './DropdownStyle';

const local_data = [
{
Expand Down Expand Up @@ -60,27 +61,4 @@ const SelectCountryScreen: React.FC<Props> = (_props) => {
);
};

export default SelectCountryScreen;

const styles = StyleSheet.create({
dropdown: {
margin: 10,
height: 30,
width: 205,
backgroundColor: '#ecf0f1',
fontSize: 12,
paddingHorizontal: 8,
border: '1px solid black',
},

placeholderStyle: {
fontSize: 12,
},
selectedTextStyle: {
fontSize: 15,
marginLeft: 8,
},
formchild: {
marginTop: 5,
},
});
export default SelectCountryScreen;
24 changes: 24 additions & 0 deletions src/components/CreateGoalForm/DropdownStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { StyleSheet } from "react-native";

export const styles = StyleSheet.create({
dropdown: {
margin: 10,
height: 30,
width: 205,
backgroundColor: '#ecf0f1',
fontSize: 12,
paddingHorizontal: 8,
border: '1px solid black',
},

placeholderStyle: {
fontSize: 12,
},
selectedTextStyle: {
fontSize: 15,
marginLeft: 8,
},
formchild: {
marginTop: 5,
},
});
13 changes: 3 additions & 10 deletions src/components/CreateGoalForm/RadioGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useState } from 'react';
import RadioGroup from 'react-native-radio-buttons-group';
import { Text, View, StyleSheet } from 'react-native';
import { Text, View} from 'react-native';
import { styles } from './RadioGroupStyle';

const radioButtonsData = [
{
Expand Down Expand Up @@ -34,12 +35,4 @@ export default function RadioGroupComponent() {
/>
</View>
);
}

const styles = StyleSheet.create({
header: {
fontSize: 8,
margin: 4,
fontWeight: 'bold',
},
});
}
9 changes: 9 additions & 0 deletions src/components/CreateGoalForm/RadioGroupStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { StyleSheet } from "react-native";

export const styles = StyleSheet.create({
header: {
fontSize: 8,
margin: 4,
fontWeight: 'bold',
},
});
29 changes: 3 additions & 26 deletions src/components/CreateGoalForm/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import React, { useState } from 'react';
import {
SafeAreaView,
Text,
StyleSheet,
View,
FlatList,
TextInput,
} from 'react-native';
import { styles } from './SearchBarStyle';

const SearchBar = () => {
const [search, setSearch] = useState('');
Expand Down Expand Up @@ -63,11 +63,7 @@ const SearchBar = () => {
const ItemSeparatorView = () => {
return (
<View
style={{
height: 0.5,
width: '100%',
backgroundColor: '#C8C8C8',
}}
style={styles.itemSeparatorStyle}
/>
);
};
Expand Down Expand Up @@ -97,23 +93,4 @@ const SearchBar = () => {
);
};

const styles = StyleSheet.create({
container: {
backgroundColor: 'white',
},
itemStyle: {
padding: 10,
},
textInputStyle: {
height: 30,
width: 205,
borderWidth: 1,
paddingLeft: 10,
margin: 5,
marginLeft: 8,
borderColor: 'black',
backgroundColor: '#ecf0f1',
},
});

export default SearchBar;
export default SearchBar;
Loading
Loading