Resolve "Redesign fix: Homepage fix"

This commit is contained in:
Maria Zadnepryanets
2020-12-20 10:38:11 +00:00
committed by bl00dymarie
parent 59aef1126d
commit ada60a745b
6 changed files with 65 additions and 53 deletions
+3
View File
@@ -3,6 +3,9 @@
A menstrual cycle tracking app that's open-source and leaves your data on your phone. Use it to track your menstrual cycle and/or for fertility awareness! A menstrual cycle tracking app that's open-source and leaves your data on your phone. Use it to track your menstrual cycle and/or for fertility awareness!
Find more information on [our website](https://bloodyhealth.gitlab.io/). Find more information on [our website](https://bloodyhealth.gitlab.io/).
[<img src="https://bloodyhealth.gitlab.io/assets/get.png"
alt="Get it here"
height="55">](https://bloodyhealth.gitlab.io/release/5.apk)
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" [<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid" alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/com.drip/) height="80">](https://f-droid.org/packages/com.drip/)
+41 -38
View File
@@ -35,16 +35,19 @@ class Home extends Component {
const { status, phase, statusText } = const { status, phase, statusText } =
getFertilityStatusForDay(this.todayDateString) getFertilityStatusForDay(this.todayDateString)
const prediction = getPredictedMenses() const prediction = getPredictedMenses()
this.cycleDayText = !this.cycleDayNumber ? labels.cycleDayNotEnoughInfo
: formatWithOrdinalSuffix(this.cycleDayNumber)
this.phase = phase
this.phaseText = !phase ? statusText : formatWithOrdinalSuffix(phase)
this.prediction = determinePredictionText(prediction) this.prediction = determinePredictionText(prediction)
this.status = status this.title = `${today.dayOfMonth()} ${today.month()} ${today.year()}`
this.statusText = statusText
this.title = `${today.dayOfMonth()} ${today.month()}`
if (this.cycleDayNumber) {
this.cycleDayText = formatWithOrdinalSuffix(this.cycleDayNumber)
}
if (phase) {
this.phase = phase
this.phaseText = formatWithOrdinalSuffix(phase)
this.status = status
this.statusText = statusText
}
} }
navigateToCycleDayView = () => { navigateToCycleDayView = () => {
@@ -54,6 +57,7 @@ class Home extends Component {
render() { render() {
const { const {
cycleDayNumber,
cycleDayText, cycleDayText,
phase, phase,
phaseText, phaseText,
@@ -69,30 +73,23 @@ class Home extends Component {
contentContainerStyle={styles.contentContainer} contentContainerStyle={styles.contentContainer}
> >
<AppText style={styles.title}>{title}</AppText> <AppText style={styles.title}>{title}</AppText>
<View style={styles.line}>
{this.cycleDayNumber && ( {cycleDayNumber &&
<React.Fragment> <View style={styles.line}>
<AppText style={styles.whiteText}>{cycleDayText}</AppText> <AppText style={styles.whiteSubtitle}>{cycleDayText}</AppText>
<AppText style={styles.tourquiseText}>{labels.cycleDay}</AppText> <AppText style={styles.tourquiseText}>{labels.cycleDay}</AppText>
</React.Fragment> </View>
)} }
{!this.cycleDayNumber && <AppText>{cycleDayText}</AppText>} {phase &&
</View> <View style={styles.line}>
<View style={styles.line}> <AppText style={styles.whiteSubtitle}>{phaseText}</AppText>
{!phase && <AppText style={styles.tourquiseText}>
<AppText style={styles.tourquiseText}>{phaseText}</AppText> {labels.cyclePhase}
} </AppText>
{phase && ( <AppText style={styles.tourquiseText}>{status}</AppText>
<React.Fragment> <Asterisk />
<AppText style={styles.whiteText}>{phaseText}</AppText> </View>
<AppText style={styles.tourquiseText}> }
{labels.cyclePhase}
</AppText>
<AppText style={styles.tourquiseText}>{status}</AppText>
<Asterisk />
</React.Fragment>
)}
</View>
<View style={styles.line}> <View style={styles.line}>
<AppText style={styles.tourquiseText}>{prediction}</AppText> <AppText style={styles.tourquiseText}>{prediction}</AppText>
</View> </View>
@@ -102,7 +99,7 @@ class Home extends Component {
{phase && ( {phase && (
<View style={styles.line}> <View style={styles.line}>
<Asterisk /> <Asterisk />
<AppText style={styles.tourquiseText} linkStyle={styles.whiteText}> <AppText linkStyle={styles.whiteText}>
{statusText} {statusText}
</AppText> </AppText>
</View> </View>
@@ -119,19 +116,20 @@ const Asterisk = () => {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
asterisk: { asterisk: {
color: Colors.orange, color: Colors.orange,
paddingRight: Spacing.base paddingRight: Spacing.base,
}, },
container: { container: {
backgroundColor: Colors.purple, backgroundColor: Colors.purple,
flex: 1 flex: 1,
}, },
contentContainer: { contentContainer: {
padding: Spacing.base padding: Spacing.base,
}, },
line: { line: {
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'flex-start', justifyContent: 'flex-start',
marginBottom: Spacing.tiny marginBottom: Spacing.tiny,
marginTop: Spacing.small,
}, },
title: { title: {
color: Colors.purpleLight, color: Colors.purpleLight,
@@ -141,9 +139,14 @@ const styles = StyleSheet.create({
}, },
tourquiseText: { tourquiseText: {
color: Colors.tourquise, color: Colors.tourquise,
fontSize: Sizes.subtitle,
},
whiteSubtitle: {
color: 'white',
fontSize: Sizes.subtitle,
}, },
whiteText: { whiteText: {
color: 'white' color: 'white',
} }
}) })
+3
View File
@@ -1,3 +1,5 @@
import { PixelRatio } from 'react-native'
export const ACTION_DELETE = 'delete' export const ACTION_DELETE = 'delete'
export const ACTION_EXPORT = 'export' export const ACTION_EXPORT = 'export'
export const ACTION_IMPORT = 'import' export const ACTION_IMPORT = 'import'
@@ -14,6 +16,7 @@ export const SYMPTOMS = [
'note', 'note',
] ]
export const fontRatio = PixelRatio.getFontScale()
export const CHART_COLUMN_WIDTH = 32 export const CHART_COLUMN_WIDTH = 32
export const CHART_COLUMN_MIDDLE = CHART_COLUMN_WIDTH / 2 export const CHART_COLUMN_MIDDLE = CHART_COLUMN_WIDTH / 2
export const CHART_DOT_RADIUS = 6 export const CHART_DOT_RADIUS = 6
+1 -2
View File
@@ -2,7 +2,6 @@ import labels from './settings'
const settingsTitles = labels.menuItems const settingsTitles = labels.menuItems
export const home = { export const home = {
cycleDayNotEnoughInfo: "We don't have enough information to know what your current cycle day is.",
unknown: '?', unknown: '?',
phase: n => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`, phase: n => `${['1st', '2nd', '3rd'][n - 1]} cycle phase`,
cycleDay: ' day of your cycle', cycleDay: ' day of your cycle',
@@ -70,7 +69,7 @@ export const stats = {
} }
export const bleedingPrediction = { export const bleedingPrediction = {
noPrediction: 'There is not enough period data to predict the next one.', noPrediction: `As soon as you have tracked 3 menstrual cycles, drip will make predictions for the next ones.`,
predictionInFuture: (startDays, endDays) => `Your next period is likely to start in ${startDays} to ${endDays} days.`, predictionInFuture: (startDays, endDays) => `Your next period is likely to start in ${startDays} to ${endDays} days.`,
predictionStartedXDaysLeft: (numberOfDays) => `Your period is likely to start today or during the next ${numberOfDays} days.`, predictionStartedXDaysLeft: (numberOfDays) => `Your period is likely to start today or during the next ${numberOfDays} days.`,
predictionStarted1DayLeft: 'Your period is likely to start today or tomorrow.', predictionStarted1DayLeft: 'Your period is likely to start today or tomorrow.',
+6 -4
View File
@@ -1,8 +1,10 @@
import { fontRatio } from '../config'
export default { export default {
tiny: 4, tiny: 4 / fontRatio,
small: 10, small: 10 / fontRatio,
base: 16, base: 16 / fontRatio,
large: 20, large: 20 / fontRatio,
symptomTileWidth: '48%', symptomTileWidth: '48%',
textWidth: '70%' textWidth: '70%'
} }
+11 -9
View File
@@ -1,3 +1,5 @@
import { fontRatio } from '../config'
import Colors from './colors' import Colors from './colors'
import Spacing from './spacing' import Spacing from './spacing'
@@ -7,13 +9,13 @@ export const fonts = {
} }
export const sizes = { export const sizes = {
tiny: 7, tiny: 7 / fontRatio,
footnote: 10, footnote: 10 / fontRatio,
small: 14, small: 14 / fontRatio,
base: 18, base: 18 / fontRatio,
subtitle: 22, subtitle: 22 / fontRatio,
title: 24, title: 24 / fontRatio,
huge: 40 huge: 32 / fontRatio,
} }
const accentText = { const accentText = {
@@ -24,12 +26,12 @@ const accentText = {
const accentTextBig = { const accentTextBig = {
...accentText, ...accentText,
fontSize: 30, fontSize: 30 / fontRatio,
} }
const accentTextGiant = { const accentTextGiant = {
...accentText, ...accentText,
fontSize: 50, fontSize: 50 / fontRatio,
} }
const accentTextHuge = { const accentTextHuge = {