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
8357d611
Commit
8357d611
authored
6 years ago
by
tina
Browse files
Options
Downloads
Patches
Plain Diff
reduces footer actions to save, leaving no possibility to delete data once it was saved
parent
bd8cb48f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/cycle-day/symptoms/action-button-footer.js
+23
-45
23 additions, 45 deletions
components/cycle-day/symptoms/action-button-footer.js
components/cycle-day/symptoms/bleeding.js
+0
-1
0 additions, 1 deletion
components/cycle-day/symptoms/bleeding.js
with
23 additions
and
46 deletions
components/cycle-day/symptoms/action-button-footer.js
+
23
−
45
View file @
8357d611
...
...
@@ -3,13 +3,11 @@ import {
View
,
TouchableOpacity
,
Text
}
from
'
react-native
'
import
Icon
from
'
react-native-vector-icons/MaterialCommunityIcons
'
import
{
saveSymptom
}
from
'
../../../db
'
import
styles
,
{
iconStyles
}
from
'
../../../styles
'
export
default
class
ActionButtonFooter
extends
Component
{
render
()
{
const
{
symptom
,
cycleDay
,
saveAction
,
saveDisabled
,
...
...
@@ -17,53 +15,33 @@ export default class ActionButtonFooter extends Component {
autoShowDayView
=
true
}
=
this
.
props
const
navigateToOverView
=
()
=>
navigate
(
'
CycleDay
'
,
{
cycleDay
})
const
b
utton
s
=
[
{
title
:
'
Cancel
'
,
action
:
()
=>
navigateToOverView
(),
i
con
:
'
cancel
'
const
saveB
utton
=
{
title
:
'
Save
'
,
action
:
()
=>
{
saveAction
()
i
f
(
autoShowDayView
)
navigateToOverView
()
},
{
title
:
'
Delete
'
,
action
:
()
=>
{
saveSymptom
(
symptom
,
cycleDay
)
navigateToOverView
()
},
disabledCondition
:
!
cycleDay
[
symptom
],
icon
:
'
delete-outline
'
},
{
title
:
'
Save
'
,
action
:
()
=>
{
saveAction
()
if
(
autoShowDayView
)
navigateToOverView
()
},
disabledCondition
:
saveDisabled
,
icon
:
'
content-save-outline
'
}
]
disabledCondition
:
saveDisabled
,
icon
:
'
content-save-outline
'
}
const
textStyle
=
saveButton
.
disabledCondition
?
styles
.
menuTextInActive
:
styles
.
menuText
const
iconStyle
=
saveButton
.
disabledCondition
?
Object
.
assign
({},
iconStyles
.
menuIcon
,
iconStyles
.
menuIconInactive
)
:
iconStyles
.
menuIcon
return
(
<
View
style
=
{
styles
.
menu
}
>
{
buttons
.
map
(({
title
,
action
,
disabledCondition
,
icon
},
i
)
=>
{
const
textStyle
=
disabledCondition
?
styles
.
menuTextInActive
:
styles
.
menuText
const
iconStyle
=
disabledCondition
?
Object
.
assign
({},
iconStyles
.
menuIcon
,
iconStyles
.
menuIconInactive
)
:
iconStyles
.
menuIcon
return
(
<
TouchableOpacity
onPress
=
{
action
}
style
=
{
styles
.
menuItem
}
disabled
=
{
disabledCondition
}
key
=
{
i
.
toString
()}
>
<
Icon
name
=
{
icon
}
{...
iconStyle
}
/
>
<
Text
style
=
{
textStyle
}
>
{
title
}
<
/Text
>
<
/TouchableOpacity
>
)
})}
<
TouchableOpacity
onPress
=
{
saveButton
.
action
}
style
=
{
styles
.
menuItem
}
disabled
=
{
saveButton
.
disabledCondition
}
key
=
{
'
save
'
}
>
<
Icon
name
=
{
saveButton
.
icon
}
{...
iconStyle
}
/
>
<
Text
style
=
{
textStyle
}
>
{
saveButton
.
title
}
<
/Text
>
<
/TouchableOpacity
>
<
/View
>
)
}
...
...
This diff is collapsed.
Click to expand it.
components/cycle-day/symptoms/bleeding.js
+
0
−
1
View file @
8357d611
...
...
@@ -56,7 +56,6 @@ export default class Bleeding extends Component {
<
/SymptomSection
>
<
/ScrollView
>
<
ActionButtonFooter
symptom
=
'
bleeding
'
cycleDay
=
{
this
.
props
.
cycleDay
}
saveAction
=
{()
=>
{
saveSymptom
(
'
bleeding
'
,
this
.
props
.
cycleDay
,
{
...
...
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