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 1 commit
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
6 changes: 5 additions & 1 deletion src/components/ButtonWidget.tsx
Original file line number Diff line number Diff line change
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 Down Expand Up @@ -68,6 +68,10 @@ const styles = StyleSheet.create({
iconStyle: {
borderRadius: 15,
},
imageStyle:{
height: 50,
width: 50
}
});

export default ButtonWidget;
5 changes: 4 additions & 1 deletion src/components/CreateGoalForm/CreateGoalform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ 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>
Expand Down Expand Up @@ -130,4 +130,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},
buttonText:{
color: 'white'
}
});
24 changes: 13 additions & 11 deletions src/components/CreateGoalForm/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,8 @@ const DatePickerComponent = () => {
confirmBtnText="Confirm"
cancelBtnText="Cancel"
customStyles={{
dateIcon: {
position: 'absolute',
left: 0,
top: 4,
marginLeft: 0,
},
dateInput: {
marginLeft: 36,
height: 30,
border: 'none',
},
dateIcon: styles.dateIconStyle,
dateInput: styles.dateInputStyle,
}}
onDateChange={() => {
setDate(date);
Expand All @@ -55,4 +46,15 @@ const styles = StyleSheet.create({
width: 205,
marginTop: 2,
},
dateIconStyle:{
position: 'absolute',
left: 0,
top: 4,
marginLeft: 0,
},
dateInputStyle:{
marginLeft: 36,
height: 30,
border: 'none',
}
});
iUttamRao marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 6 additions & 5 deletions src/components/CreateGoalForm/SearchBar.tsx
Original file line number Diff line number Diff line change
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 @@ -114,6 +110,11 @@ const styles = StyleSheet.create({
borderColor: 'black',
backgroundColor: '#ecf0f1',
},
itemSeparatorStyle: {
height: 0.5,
width: '100%',
backgroundColor: '#C8C8C8',
}
});

export default SearchBar;
10 changes: 9 additions & 1 deletion src/components/CustomProgressBar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { StyleSheet } from 'react-native';
import { View, Text } from 'react-native';
import * as Progress from 'react-native-progress';

Expand All @@ -13,7 +14,7 @@ const CustomProgressBar = ({
}) => {
return (
<View>
<Text style={{ color: 'black', margin: 10 }}>{text}</Text>
<Text style={styles.text}>{text}</Text>
<Progress.Bar
progress={progress}
color={color}
Expand All @@ -27,4 +28,11 @@ const CustomProgressBar = ({
);
};

const styles = StyleSheet.create({
text:{
color: 'black',
margin: 10
}
})

export default CustomProgressBar;
15 changes: 12 additions & 3 deletions src/components/Modal/ProgressModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function ProgressModal() {
};

return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<View style={styles.viewContainer}>
<TouchableOpacity onPress={toggleModal}>
<CircularProgress
value={progress}
Expand Down Expand Up @@ -55,7 +55,7 @@ function ProgressModal() {
<Card.Content>
<Paragraph>Slide to update progress:</Paragraph>
<Slider
style={{ width: '80%', alignSelf: 'center' }}
style={styles.sliderStyle}
value={progress}
onValueChange={handleSliderChange}
minimumValue={0}
Expand All @@ -64,7 +64,7 @@ function ProgressModal() {
/>
<Paragraph>Current Progress: {progress}%</Paragraph>
</Card.Content>
<Button style={styles.button} onPress={toggleModal}>
<Button style={styles.Button} onPress={toggleModal}>
Close
</Button>
</Card>
Expand All @@ -75,6 +75,11 @@ function ProgressModal() {
}

const styles = StyleSheet.create({
viewContainer:{
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
cardContainer: {
margin: 20,
padding: 15,
Expand Down Expand Up @@ -118,5 +123,9 @@ const styles = StyleSheet.create({
padding: 10,
borderRadius: 8,
},
sliderStyle:{
width: '80%',
alignSelf: 'center'
}
});
export default ProgressModal;
6 changes: 3 additions & 3 deletions src/components/ShortGoalsComponent/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const Card = ({ item }: any) => {
<View style={[CardStyles.flex, CardStyles.container]}>
<View style={CardStyles.flex}>
<Image source={Images.commentIcon} style={CardStyles.commentIcon} />
<Text style={{ color: 'blue' }}>{item.messageCount}</Text>
<Text style={CardStyles.messageCount}>{item.messageCount}</Text>
</View>
<Text style={{ color: 'red' }}>Due in {item.dueDate} days</Text>
<Text style={CardStyles.dueDate}>Due in {item.dueDate} days</Text>
<TouchableOpacity style={[CardStyles.doneBtn, CardStyles.flex]}>
<Text style={{ color: 'white', fontWeight: 'bold' }}>
<Text style={CardStyles.MarkAsDone}>
Mark as done
</Text>
<Image source={Images.doneIcon} style={CardStyles.doneIcon} />
Expand Down
10 changes: 10 additions & 0 deletions src/components/ShortGoalsComponent/Styles/CardStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,14 @@ export const CardStyles = StyleSheet.create({
width: 17,
height: 17,
},
messageCount:{
color: 'blue'
},
dueDate:{
color: 'red'
},
MarkAsDone:{
color: 'white',
fontWeight: 'bold'
}
});
13 changes: 7 additions & 6 deletions src/components/ToDoComponent/TodoComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ const TodoComponent = () => {
onPress={() => navigation.navigate('CreatingGoals')}
>
<Text
style={{
color: 'black',
elevation: 10,
paddingHorizontal: 6,
paddingVertical: 6,
}}
style={styles.addText}
>
Add
</Text>
Expand Down Expand Up @@ -123,6 +118,12 @@ const styles = StyleSheet.create({
paddingLeft: 15,
paddingRight: 15,
},
addText:{
color: 'black',
elevation: 10,
paddingHorizontal: 6,
paddingVertical: 6,
}
});

export default TodoComponent;
Loading