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
0da3810a
Commit
0da3810a
authored
6 years ago
by
emelko
Browse files
Options
Downloads
Patches
Plain Diff
Better naming for bleedin labels
parent
d89e1038
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/bleeding.js
+102
-0
102 additions, 0 deletions
components/bleeding.js
components/cycle-day/cycle-day-overview.js
+2
-2
2 additions, 2 deletions
components/cycle-day/cycle-day-overview.js
with
104 additions
and
2 deletions
components/bleeding.js
0 → 100644
+
102
−
0
View file @
0da3810a
import
React
,
{
Component
}
from
'
react
'
import
{
View
,
Button
,
Text
,
Switch
}
from
'
react-native
'
import
RadioForm
from
'
react-native-simple-radio-button
'
import
styles
from
'
../styles/index
'
import
{
saveBleeding
}
from
'
../db
'
import
{
bleeding
as
bleedingLabels
}
from
'
../labels/labels
'
export
default
class
Bleeding
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
cycleDay
=
props
.
cycleDay
this
.
showView
=
props
.
showView
let
bleedingValue
=
this
.
cycleDay
.
bleeding
&&
this
.
cycleDay
.
bleeding
.
value
if
(
!
(
typeof
bleedingValue
===
'
number
'
)
){
bleedingValue
=
-
1
}
this
.
state
=
{
currentValue
:
bleedingValue
,
exclude
:
this
.
cycleDay
.
bleeding
?
this
.
cycleDay
.
bleeding
.
exclude
:
false
}
}
render
()
{
const
bleedingRadioProps
=
[
{
label
:
bleedingLabels
[
0
],
value
:
0
},
{
label
:
bleedingLabels
[
1
],
value
:
1
},
{
label
:
bleedingLabels
[
2
],
value
:
2
},
{
label
:
bleedingLabels
[
3
],
value
:
3
},
]
return
(
<
View
style
=
{
styles
.
symptomEditView
}
>
<
View
style
=
{
styles
.
symptomEditSplitSymptomsAndLastRowButtons
}
>
<
View
style
=
{
styles
.
symptomEditListedSymptomView
}
>
<
View
style
=
{{
flex
:
1
}}
>
<
Text
style
=
{
styles
.
symptomDayView
}
>
Bleeding
<
/Text
>
<
/View
>
<
View
style
=
{{
flex
:
1
}}
>
<
RadioForm
radio_props
=
{
bleedingRadioProps
}
initial
=
{
this
.
state
.
currentValue
}
formHorizontal
=
{
true
}
labelHorizontal
=
{
false
}
labelStyle
=
{
styles
.
radioButton
}
onPress
=
{(
itemValue
)
=>
{
this
.
setState
({
currentValue
:
itemValue
})
}}
/
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
itemsInRowSeparatedView
}
>
<
View
style
=
{
styles
.
singleButtonView
}
>
<
Text
style
=
{
styles
.
symptomDayView
}
>
Exclude
<
/Text
>
<
/View
>
<
View
style
=
{
styles
.
singleButtonView
}
>
<
Switch
onValueChange
=
{(
val
)
=>
{
this
.
setState
({
exclude
:
val
})
}}
value
=
{
this
.
state
.
exclude
}
/
>
<
/View
>
<
/View
>
<
/View
>
<
View
style
=
{
styles
.
itemsInRowSeparatedView
}
>
<
View
style
=
{
styles
.
singleButtonView
}
>
<
Button
onPress
=
{()
=>
this
.
showView
(
'
dayView
'
)}
title
=
"
Cancel
"
>
<
/Button
>
<
/View
>
<
View
style
=
{
styles
.
singleButtonView
}
>
<
Button
onPress
=
{()
=>
{
saveBleeding
(
this
.
cycleDay
)
this
.
showView
(
'
dayView
'
)
}}
title
=
"
Delete
"
>
<
/Button
>
<
/View
>
<
View
style
=
{
styles
.
singleButtonView
}
>
<
Button
onPress
=
{()
=>
{
saveBleeding
(
this
.
cycleDay
,
{
value
:
this
.
state
.
currentValue
,
exclude
:
this
.
state
.
exclude
})
this
.
showView
(
'
dayView
'
)
}}
disabled
=
{
this
.
state
.
currentValue
===
-
1
}
title
=
"
Save
"
>
<
/Button
>
<
/View
>
<
/View
>
<
/View
>
)
}
}
This diff is collapsed.
Click to expand it.
components/cycle-day/cycle-day-overview.js
+
2
−
2
View file @
0da3810a
...
...
@@ -6,7 +6,7 @@ import {
}
from
'
react-native
'
import
styles
from
'
../../styles
'
import
{
bleeding
as
l
abels
,
bleeding
as
bleedingL
abels
,
mucusFeeling
as
feelingLabels
,
mucusTexture
as
textureLabels
,
mucusNFP
as
computeSensiplanMucusLabels
,
...
...
@@ -44,7 +44,7 @@ export default class DayView extends Component {
const
bleedingValue
=
this
.
cycleDay
.
bleeding
&&
this
.
cycleDay
.
bleeding
.
value
let
bleedingLabel
if
(
typeof
bleedingValue
===
'
number
'
)
{
bleedingLabel
=
`
${
l
abels
[
bleedingValue
]}
`
bleedingLabel
=
`
${
bleedingL
abels
[
bleedingValue
]}
`
if
(
this
.
cycleDay
.
bleeding
.
exclude
)
bleedingLabel
=
"
(
"
+
bleedingLabel
+
"
)
"
}
else
{
bleedingLabel
=
'
edit
'
...
...
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