Calendar redesign

This commit is contained in:
Maria Zadnepryanets
2020-08-22 10:57:44 +00:00
committed by Sofiya Tepikin
parent 885da5c293
commit 5a555f5965
61 changed files with 213 additions and 682 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ import { getCycleDay } from '../../db'
import { getData } from '../helpers/cycle-day'
import { general as labels} from '../../i18n/en/cycle-day'
import { Spacing } from '../../styles/redesign'
import { Spacing } from '../../styles'
import { SYMPTOMS } from '../../config'
class CycleDayOverView extends Component {
+1 -1
View File
@@ -4,7 +4,7 @@ import { StyleSheet, TouchableOpacity, View } from 'react-native'
import AppText from '../common/app-text'
import { Colors, Containers } from '../../styles/redesign'
import { Colors, Containers } from '../../styles'
const SelectBoxGroup = ({ labels, optionsState, onSelect }) => {
return (
+1 -1
View File
@@ -4,7 +4,7 @@ import { StyleSheet, TouchableOpacity, View } from 'react-native'
import AppText from '../common/app-text'
import { Colors, Containers } from '../../styles/redesign'
import { Colors, Containers } from '../../styles'
export default function SelectTabGroup({ activeButton, buttons, onSelect }) {
return (
+1 -1
View File
@@ -10,7 +10,7 @@ import { connect } from 'react-redux'
import { getDate } from '../../slices/date'
import { isDateInFuture } from '../helpers/cycle-day'
import { Colors, Sizes, Spacing } from '../../styles/redesign'
import { Colors, Sizes, Spacing } from '../../styles'
import { headerTitles as symptomTitles } from '../../i18n/en/labels'
class SymptomBox extends Component {
+21 -16
View File
@@ -1,6 +1,6 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { ScrollView, StyleSheet, View } from 'react-native'
import { Dimensions, ScrollView, StyleSheet, View } from 'react-native'
import AppModal from '../common/app-modal'
import AppSwitch from '../common/app-switch'
@@ -19,7 +19,7 @@ import { blank, save, shouldShow, symtomPage } from '../helpers/cycle-day'
import { shared as sharedLabels } from '../../i18n/en/labels'
import info from '../../i18n/en/symptom-info'
import { Containers, Sizes } from '../../styles/redesign'
import { Colors, Containers, Sizes, Spacing } from '../../styles'
class SymptomEditView extends Component {
@@ -151,7 +151,6 @@ class SymptomEditView extends Component {
<AppModal onClose={onClose}>
<ScrollView
contentContainerStyle={styles.modalContainer}
pagingEnabled={true}
style={styles.modalWindow}
>
<View style={styles.headerContainer}>
@@ -165,7 +164,7 @@ class SymptomEditView extends Component {
}
{shouldTabGroup && symtomPage[symptom].selectTabGroups.map(group => {
return (
<Segment key={group.key}>
<Segment key={group.key} style={styles.segmentBorder}>
<AppText style={styles.title}>{group.title}</AppText>
<SelectTabGroup
activeButton={data[group.key]}
@@ -183,7 +182,7 @@ class SymptomEditView extends Component {
&& Object.keys(group.options).includes('other')
return (
<Segment key={group.key}>
<Segment key={group.key} style={styles.segmentBorder} >
<AppText style={styles.title}>{group.title}</AppText>
<SelectBoxGroup
labels={group.options}
@@ -203,7 +202,7 @@ class SymptomEditView extends Component {
})
}
{shouldShowExclude &&
<Segment>
<Segment style={styles.segmentBorder} >
<AppSwitch
onToggle={this.onExcludeToggle}
text={symtomPage[symptom].excludeText}
@@ -212,7 +211,7 @@ class SymptomEditView extends Component {
</Segment>
}
{shouldShowNote &&
<Segment>
<Segment style={styles.segmentBorder} >
<AppText>{symtomPage[symptom].note}</AppText>
<AppTextInput
multiline={true}
@@ -225,15 +224,17 @@ class SymptomEditView extends Component {
}
<View style={styles.buttonsContainer}>
<Button iconName={iconName} isSmall onPress={this.onPressLearnMore}>
learn more
{sharedLabels.learnMore}
</Button>
<Button isSmall onPress={this.onRemove}>
remove
{sharedLabels.remove}
</Button>
<Button isCTA isSmall onPress={this.onSave}>
{sharedLabels.save}
</Button>
<Button isCTA isSmall onPress={this.onSave}>save</Button>
</View>
{shouldShowInfo &&
<Segment last>
<Segment last style={styles.segmentBorder} >
<AppText>{info[symptom].text}</AppText>
</Segment>
}
@@ -250,19 +251,23 @@ const styles = StyleSheet.create({
headerContainer: {
flexDirection: 'row',
justifyContent: 'flex-end',
paddingVertical: Sizes.tiny,
paddingVertical: Spacing.tiny,
},
modalContainer: {
flexGrow: 1,
padding: Sizes.small
flex: 1,
padding: Spacing.small,
paddingBottom: Spacing.base
},
modalWindow: {
backgroundColor: 'white',
borderRadius: 10,
marginVertical: Sizes.huge * 2,
position: 'absolute',
minHeight: '40%',
height: '70%',
position: 'absolute'
maxHeight: Dimensions.get('window').height * 0.7
},
segmentBorder: {
borderBottomColor: Colors.greyLight
},
title: {
fontSize: Sizes.subtitle
+1 -1
View File
@@ -14,7 +14,7 @@ import {
isTomorrowInFuture,
isYesterdayInFuture
} from '../helpers/cycle-day'
import { Colors, Containers, Spacing, Typography } from '../../styles/redesign'
import { Colors, Containers, Spacing, Typography } from '../../styles'
const SymptomPageTitle = ({
date,
+1 -1
View File
@@ -15,7 +15,7 @@ import { isTemperatureOutOfRange, isPreviousTemperature } from '../helpers/cycle
import { temperature as labels } from '../../i18n/en/cycle-day'
import { Colors, Containers, Sizes, Spacing } from '../../styles/redesign'
import { Colors, Containers, Sizes, Spacing } from '../../styles'
const formatTemperature = value => value === null
? value