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
0c22644c
Commit
0c22644c
authored
6 years ago
by
mashazyu
Browse files
Options
Downloads
Patches
Plain Diff
Extracts buttons on home screen as a component
parent
9131c7a6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/home.js
+27
-24
27 additions, 24 deletions
components/home.js
with
27 additions
and
24 deletions
components/home.js
+
27
−
24
View file @
0c22644c
...
...
@@ -14,6 +14,19 @@ import styles from '../styles'
import
AppText
,
{
AppTextLight
}
from
'
./app-text
'
import
nothingChanged
from
'
../db/db-unchanged
'
const
HomeButton
=
({
backgroundColor
,
children
})
=>
{
return
(
<
View
style
=
{[
styles
.
homeButton
,
{
backgroundColor
}
]}
>
<
AppText
style
=
{
styles
.
homeButtonText
}
>
{
children
}
<
/AppText
>
<
/View
>
)
}
export
default
class
Home
extends
Component
{
constructor
(
props
)
{
super
(
props
)
...
...
@@ -92,14 +105,11 @@ export default class Home extends Component {
{
this
.
state
.
showMore
&&
<
AppText
style
=
{
styles
.
paragraph
}
>
{
cycleDayMoreText
}
<
/AppText
>
}
<
View
style
=
{[
styles
.
homeButton
,
{
backgroundColor
:
cycleDayColor
}
]}
>
<
AppText
style
=
{
styles
.
homeButtonText
}
>
{
labels
.
editToday
}
<
/AppText
>
<
/View
>
<
HomeButton
backgroundColor
=
{
cycleDayColor
}
>
{
labels
.
editToday
}
<
/HomeButton
>
<
/TouchableOpacity
>
<
TouchableOpacity
...
...
@@ -120,14 +130,11 @@ export default class Home extends Component {
{
this
.
state
.
predictionText
}
<
/AppText
>
}
<
View
style
=
{[
styles
.
homeButton
,
{
backgroundColor
:
periodColor
}
]}
>
<
AppText
style
=
{
styles
.
homeButtonText
}
>
{
labels
.
trackPeriod
}
<
/AppText
>
<
/View
>
<
HomeButton
backgroundColor
=
{
periodColor
}
>
{
labels
.
trackPeriod
}
<
/HomeButton
>
<
/TouchableOpacity
>
<
TouchableOpacity
...
...
@@ -153,14 +160,10 @@ export default class Home extends Component {
{
this
.
state
.
statusText
}
<
/AppText
>
}
<
View
style
=
{[
styles
.
homeButton
,
{
backgroundColor
:
secondaryColor
}
]}
>
<
AppText
style
=
{
styles
.
homeButtonText
}
>
{
labels
.
checkFertility
}
<
/AppText
>
<
/View
>
<
HomeButton
backgroundColor
=
{
secondaryColor
}
>
{
labels
.
checkFertility
}
<
/HomeButton
>
<
/TouchableOpacity
>
<
/View
>
...
...
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