Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
86e0d967
Commit
86e0d967
authored
6 years ago
by
Julia Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Pass correct props to bleeding edit view from home screen
parent
a9e22c94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/home.js
+16
-23
16 additions, 23 deletions
components/home.js
with
16 additions
and
23 deletions
components/home.js
+
16
−
23
View file @
86e0d967
import
React
,
{
Component
}
from
'
react
'
import
React
,
{
Component
}
from
'
react
'
import
{
ScrollView
,
View
,
TouchableOpacity
,
TouchableHighlight
,
Dimensions
}
from
'
react-native
'
import
{
ScrollView
,
View
,
TouchableHighlight
,
Dimensions
}
from
'
react-native
'
import
{
LocalDate
,
ChronoUnit
}
from
'
js-joda
'
import
{
LocalDate
,
ChronoUnit
}
from
'
js-joda
'
import
Icon
from
'
react-native-vector-icons/Entypo
'
import
Icon
from
'
react-native-vector-icons/Entypo
'
import
{
secondaryColor
,
cycleDayColor
,
periodColor
}
from
'
../styles
'
import
{
secondaryColor
,
cycleDayColor
,
periodColor
}
from
'
../styles
'
import
{
home
as
labels
,
bleedingPrediction
as
predictLabels
,
shared
}
from
'
../i18n/en/labels
'
import
{
home
as
labels
,
bleedingPrediction
as
predictLabels
,
shared
}
from
'
../i18n/en/labels
'
import
cycleModule
from
'
../lib/cycle
'
import
cycleModule
from
'
../lib/cycle
'
import
{
getCycleDaysSortedByDate
}
from
'
../db
'
import
{
getCycleDaysSortedByDate
,
getCycleDay
}
from
'
../db
'
import
{
getFertilityStatusForDay
}
from
'
../lib/sympto-adapter
'
import
{
getFertilityStatusForDay
}
from
'
../lib/sympto-adapter
'
import
styles
from
'
../styles
'
import
styles
from
'
../styles
'
import
AppText
,
{
AppTextLight
}
from
'
./app-text
'
import
AppText
,
{
AppTextLight
}
from
'
./app-text
'
...
@@ -46,13 +46,8 @@ export default class Home extends Component {
...
@@ -46,13 +46,8 @@ export default class Home extends Component {
return
(
return
(
<
View
flex
=
{
1
}
>
<
View
flex
=
{
1
}
>
<
ScrollView
>
<
ScrollView
>
<
View
<
View
style
=
{
styles
.
homeView
}
>
style
=
{
styles
.
homeView
}
<
View
style
=
{
styles
.
homeIconElement
}
>
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
passTodayTo
(
'
CycleDay
'
)}
style
=
{
styles
.
homeIconElement
}
>
<
View
position
=
'
absolute
'
>
<
View
position
=
'
absolute
'
>
<
DripHomeIcon
name
=
"
circle
"
size
=
{
80
}
color
=
{
cycleDayColor
}
/
>
<
DripHomeIcon
name
=
"
circle
"
size
=
{
80
}
color
=
{
cycleDayColor
}
/
>
<
/View
>
<
/View
>
...
@@ -72,12 +67,9 @@ export default class Home extends Component {
...
@@ -72,12 +67,9 @@ export default class Home extends Component {
{
labels
.
editToday
}
{
labels
.
editToday
}
<
/Button
>
<
/Button
>
<
/
TouchableOpacity
>
<
/
View
>
<
TouchableOpacity
<
View
style
=
{
styles
.
homeIconElement
}
>
onPress
=
{()
=>
this
.
passTodayTo
(
'
BleedingEditView
'
)}
style
=
{
styles
.
homeIconElement
}
>
<
View
position
=
'
absolute
'
>
<
View
position
=
'
absolute
'
>
<
DripHomeIcon
name
=
"
drop
"
size
=
{
105
}
color
=
{
periodColor
}
/
>
<
DripHomeIcon
name
=
"
drop
"
size
=
{
105
}
color
=
{
periodColor
}
/
>
<
/View
>
<
/View
>
...
@@ -94,20 +86,21 @@ export default class Home extends Component {
...
@@ -94,20 +86,21 @@ export default class Home extends Component {
}
}
<
Button
<
Button
onPress
=
{()
=>
this
.
passTodayTo
(
'
BleedingEditView
'
)}
onPress
=
{()
=>
{
const
today
=
LocalDate
.
now
().
toString
()
const
cycleDay
=
getCycleDay
(
today
)
const
props
=
{
date
:
today
}
if
(
cycleDay
)
props
.
cycleDay
=
cycleDay
this
.
props
.
navigate
(
'
BleedingEditView
'
,
props
)
}}
backgroundColor
=
{
periodColor
}
>
backgroundColor
=
{
periodColor
}
>
{
labels
.
trackPeriod
}
{
labels
.
trackPeriod
}
<
/Button
>
<
/Button
>
<
/TouchableOpacity
>
<
/View
>
<
TouchableOpacity
onPress
=
{()
=>
this
.
props
.
navigate
(
'
Chart
'
)}
style
=
{
styles
.
homeIconElement
}
>
<
View
style
=
{
styles
.
homeIconElement
}
>
<
View
style
=
{
styles
.
homeCircle
}
position
=
'
absolute
'
/>
<
View
style
=
{
styles
.
homeCircle
}
position
=
'
absolute
'
/>
<
View
style
=
{[
styles
.
homeIconTextWrapper
,
styles
.
wrapperCircle
]}
>
<
View
style
=
{[
styles
.
homeIconTextWrapper
,
styles
.
wrapperCircle
]}
>
<
AppTextLight
style
=
{
styles
.
iconText
}
>
<
AppTextLight
style
=
{
styles
.
iconText
}
>
{
this
.
state
.
phase
?
{
this
.
state
.
phase
?
...
@@ -133,7 +126,7 @@ export default class Home extends Component {
...
@@ -133,7 +126,7 @@ export default class Home extends Component {
backgroundColor
=
{
secondaryColor
}
>
backgroundColor
=
{
secondaryColor
}
>
{
labels
.
checkFertility
}
{
labels
.
checkFertility
}
<
/Button
>
<
/Button
>
<
/
TouchableOpacity
>
<
/
View
>
<
/View
>
<
/View
>
<
/ScrollView
>
<
/ScrollView
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment