-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix inconsistencies in styling management- colocate all styles i…
…nto their own external style scripts
- Loading branch information
1 parent
bedea96
commit d892529
Showing
16 changed files
with
390 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,21 @@ | ||
import React from "react"; | ||
import { StyleSheet, Text, TouchableOpacity } from "react-native"; | ||
import { Text, TouchableOpacity } from "react-native"; | ||
|
||
import ButtonStyles from "./ButtonStyles"; | ||
|
||
function Button({ onPress, text, innerColor, style, transform }) { | ||
return ( | ||
<TouchableOpacity onPress={onPress} style={[styles.button, style]}> | ||
<TouchableOpacity onPress={onPress} style={[ButtonStyles.button, style]}> | ||
<Text | ||
style={{ | ||
textAlign: "center", | ||
color: innerColor, | ||
fontSize: 17, | ||
fontWeight: "700", | ||
textTransform: transform && "uppercase" | ||
}} | ||
style={[ | ||
ButtonStyles.buttonText, | ||
{ color: innerColor, textTransform: transform && "uppercase" } | ||
]} | ||
> | ||
{text} | ||
</Text> | ||
</TouchableOpacity> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
button: { | ||
color: "#dac", | ||
marginLeft: 20, | ||
marginRight: 20, | ||
padding: 17, | ||
borderRadius: 4, | ||
justifyContent: "center", | ||
marginBottom: 20 | ||
} | ||
}); | ||
|
||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { StyleSheet } from "react-native"; | ||
|
||
const ButtonStyles = StyleSheet.create({ | ||
button: { | ||
color: "#dac", | ||
marginLeft: 20, | ||
marginRight: 20, | ||
padding: 17, | ||
borderRadius: 4, | ||
justifyContent: "center", | ||
marginBottom: 20 | ||
}, | ||
buttonText: { | ||
textAlign: "center", | ||
fontSize: 17, | ||
fontWeight: "700" | ||
} | ||
}); | ||
|
||
export default ButtonStyles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { StyleSheet } from "react-native"; | ||
|
||
import { WHITE } from "../../../utils/colors"; | ||
|
||
const DeckStyles = StyleSheet.create({ | ||
card: { | ||
borderColor: WHITE, | ||
borderWidth: 1, | ||
borderRadius: 4, | ||
marginBottom: 20, | ||
shadowColor: "0 4px 8px 0 rgba(0,0,0,0.2)", | ||
minHeight: 100, | ||
flex: 1 | ||
}, | ||
titleText: { | ||
fontSize: 24, | ||
color: WHITE, | ||
fontWeight: "700", | ||
marginBottom: 10 | ||
}, | ||
countText: { color: WHITE, fontSize: 16 }, | ||
linearGradient: { | ||
padding: 15, | ||
justifyContent: "center", | ||
borderRadius: 7, | ||
height: "100%" | ||
} | ||
}); | ||
|
||
export default DeckStyles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Dimensions, StyleSheet } from "react-native"; | ||
|
||
import { UDACITY_BLUE } from "../../../utils/colors"; | ||
|
||
const QuestionStyles = StyleSheet.create({ | ||
container: { | ||
alignItems: "center" | ||
}, | ||
cardContainer: { | ||
width: Math.round(Dimensions.get("window").width) - 70, | ||
minHeight: 200, | ||
alignContent: "center" | ||
}, | ||
card: { | ||
width: "100%", | ||
height: "100%", | ||
borderRadius: 10, | ||
padding: 20, | ||
backgroundColor: UDACITY_BLUE, | ||
shadowColor: "rgba(0,0,0,0.5)", | ||
shadowOffset: { | ||
width: 0, | ||
height: 1 | ||
}, | ||
shadowOpacity: 0.5, | ||
justifyContent: "center" | ||
}, | ||
answer: { | ||
backgroundColor: "#18b300" | ||
}, | ||
label: { | ||
textAlign: "center", | ||
fontSize: 22, | ||
fontFamily: "System", | ||
color: "#ffffff", | ||
backgroundColor: "transparent" | ||
}, | ||
flipTipText: { color: "lightgray", margin: 10 } | ||
}); | ||
|
||
export default QuestionStyles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { StyleSheet } from "react-native"; | ||
|
||
import { WHITE } from "../../../utils/colors"; | ||
|
||
const DeckListStyles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
backgroundColor: WHITE, | ||
padding: 10 | ||
}, | ||
textContainer: { | ||
flex: 1, | ||
justifyContent: "center", | ||
alignItems: "center" | ||
}, | ||
noDecksText: { fontSize: 20 } | ||
}); | ||
|
||
export default DeckListStyles; |
Oops, something went wrong.