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
8ee53ba7
Commit
8ee53ba7
authored
6 years ago
by
Julia Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Extract labels and format date
parent
090f4116
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
bleeding.js
+8
-6
8 additions, 6 deletions
bleeding.js
day-view.js
+3
-1
3 additions, 1 deletion
day-view.js
db.js
+0
-1
0 additions, 1 deletion
db.js
format.js
+1
-1
1 addition, 1 deletion
format.js
labels.js
+5
-0
5 additions, 0 deletions
labels.js
with
17 additions
and
9 deletions
bleeding.js
+
8
−
6
View file @
8ee53ba7
...
@@ -8,13 +8,14 @@ import {
...
@@ -8,13 +8,14 @@ import {
import
styles
from
'
./styles
'
import
styles
from
'
./styles
'
import
{
saveBleeding
}
from
'
./db
'
import
{
saveBleeding
}
from
'
./db
'
import
{
formatDateForViewHeader
}
from
'
./format
'
import
{
formatDateForViewHeader
}
from
'
./format
'
import
{
bleeding
as
labels
}
from
'
./labels
'
export
default
class
Bleeding
extends
Component
{
export
default
class
Bleeding
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
state
=
{
this
.
state
=
{
cycleDay
:
props
.
navigation
.
state
.
params
.
cycleDay
,
cycleDay
:
props
.
navigation
.
state
.
params
.
cycleDay
,
currentValue
:
null
currentValue
:
"
1
"
}
}
}
}
...
@@ -25,16 +26,17 @@ export default class Bleeding extends Component {
...
@@ -25,16 +26,17 @@ export default class Bleeding extends Component {
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{
styles
.
welcome
}
>
{
formatDateForViewHeader
(
day
.
date
)}
<
/Text
>
<
Text
style
=
{
styles
.
welcome
}
>
{
formatDateForViewHeader
(
day
.
date
)}
<
/Text
>
<
Text
>
Bleeding
<
/Text
>
<
Picker
<
Picker
selectedValue
=
{
this
.
state
.
currentValue
}
selectedValue
=
{
this
.
state
.
currentValue
}
style
=
{{
height
:
50
,
width
:
1
0
0
}}
style
=
{{
height
:
50
,
width
:
1
5
0
}}
onValueChange
=
{(
itemValue
)
=>
{
onValueChange
=
{(
itemValue
)
=>
{
this
.
setState
({
currentValue
:
itemValue
})
this
.
setState
({
currentValue
:
itemValue
})
}}
>
}}
>
<
Picker
.
Item
label
=
"
spotting
"
value
=
"
1
"
/>
<
Picker
.
Item
label
=
{
labels
[
0
]}
value
=
"
0
"
/>
<
Picker
.
Item
label
=
"
light
"
value
=
"
2
"
/>
<
Picker
.
Item
label
=
{
labels
[
1
]}
value
=
"
1
"
/>
<
Picker
.
Item
label
=
"
medium
"
value
=
"
3
"
/>
<
Picker
.
Item
label
=
{
labels
[
2
]}
value
=
"
2
"
/>
<
Picker
.
Item
label
=
"
heavy
"
value
=
"
4
"
/>
<
Picker
.
Item
label
=
{
labels
[
3
]}
value
=
"
3
"
/>
<
/Picker
>
<
/Picker
>
<
Button
<
Button
onPress
=
{()
=>
{
onPress
=
{()
=>
{
...
...
This diff is collapsed.
Click to expand it.
day-view.js
+
3
−
1
View file @
8ee53ba7
...
@@ -6,6 +6,7 @@ import {
...
@@ -6,6 +6,7 @@ import {
}
from
'
react-native
'
}
from
'
react-native
'
import
styles
from
'
./styles
'
import
styles
from
'
./styles
'
import
{
formatDateForViewHeader
}
from
'
./format
'
import
{
formatDateForViewHeader
}
from
'
./format
'
import
{
bleeding
as
labels
}
from
'
./labels
'
export
default
class
DayView
extends
Component
{
export
default
class
DayView
extends
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -18,10 +19,11 @@ export default class DayView extends Component {
...
@@ -18,10 +19,11 @@ export default class DayView extends Component {
render
()
{
render
()
{
const
navigate
=
this
.
props
.
navigation
.
navigate
const
navigate
=
this
.
props
.
navigation
.
navigate
const
day
=
this
.
state
.
cycleDay
const
day
=
this
.
state
.
cycleDay
const
bleedingValue
=
day
.
bleeding
&&
day
.
bleeding
.
value
return
(
return
(
<
View
style
=
{
styles
.
container
}
>
<
View
style
=
{
styles
.
container
}
>
<
Text
style
=
{
styles
.
welcome
}
>
{
formatDateForViewHeader
(
day
.
date
)}
<
/Text
>
<
Text
style
=
{
styles
.
welcome
}
>
{
formatDateForViewHeader
(
day
.
date
)}
<
/Text
>
<
Text
style
=
{
styles
.
welcome
}
>
{
day
.
bleeding
&&
day
.
bleeding
.
v
alue
}
<
/Text
>
<
Text
style
=
{
styles
.
welcome
}
>
{
bleeding
Value
!=
undefined
?
labels
[
bleeding
V
alue
]
:
''
}
<
/Text
>
<
Button
<
Button
onPress
=
{()
=>
navigate
(
'
bleeding
'
,
{
cycleDay
:
day
})}
onPress
=
{()
=>
navigate
(
'
bleeding
'
,
{
cycleDay
:
day
})}
title
=
"
Edit bleeding
"
>
title
=
"
Edit bleeding
"
>
...
...
This diff is collapsed.
Click to expand it.
db.js
+
0
−
1
View file @
8ee53ba7
import
realm
from
'
realm
'
import
realm
from
'
realm
'
import
moment
from
'
moment
'
import
{
v4
as
uuid
}
from
'
uuid
'
import
{
v4
as
uuid
}
from
'
uuid
'
let
db
let
db
...
...
This diff is collapsed.
Click to expand it.
format.js
+
1
−
1
View file @
8ee53ba7
import
moment
from
"
moment
"
import
moment
from
"
moment
"
export
function
formatDateForViewHeader
(
date
)
{
export
function
formatDateForViewHeader
(
date
)
{
return
moment
(
date
).
format
()
return
moment
(
date
).
format
(
'
MMMM Do YYYY
'
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
labels.js
0 → 100644
+
5
−
0
View file @
8ee53ba7
const
bleeding
=
[
'
spotting
'
,
'
light
'
,
'
medium
'
,
'
heavy
'
]
export
{
bleeding
}
\ No newline at end of file
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