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
e9ebde91
Commit
e9ebde91
authored
6 years ago
by
tina
Browse files
Options
Downloads
Patches
Plain Diff
makes stats beautiful
parent
169af952
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/labels.js
+7
-2
7 additions, 2 deletions
components/labels.js
components/stats.js
+16
-10
16 additions, 10 deletions
components/stats.js
styles/index.js
+16
-4
16 additions, 4 deletions
styles/index.js
with
39 additions
and
16 deletions
components/labels.js
+
7
−
2
View file @
e9ebde91
...
...
@@ -68,10 +68,15 @@ export const headerTitles = {
}
export
const
stats
=
{
cycleLengthTitle
:
'
Cycle length
'
,
cycleLengthExplainer
:
'
Basic statistics about the length of your cycles.
'
,
emptyStats
:
'
At least one completed cycle is needed to present you with stats here.
'
,
oneCycleStats
:
(
number
)
=>
`You have documented one cycle of
${
number
}
days.`
,
getBasisOfStats
:
(
numberOfCycles
)
=>
`Stats are based on
${
numberOfCycles
}
completed
cycle
s.`
,
//
oneCycleStats: (number) => `You have documented one cycle of ${number} days.`,
oneCycleStats
:
'
You have documented one
cycle
of
'
,
daysLabel
:
'
days
'
,
//getBasisOfStats: (numberOfCycles) => `Stats are based on ${numberOfCycles} completed cycles.`,
basisOfStatsBeginning
:
'
Stats are based on
'
,
basisOfStatsEnd
:
'
completed cycles.
'
,
averageLabel
:
'
Average cycle length
'
,
minLabel
:
'
Shortest cycle
'
,
maxLabel
:
'
Longest cycle
'
,
...
...
This diff is collapsed.
Click to expand it.
components/stats.js
+
16
−
10
View file @
e9ebde91
...
...
@@ -26,22 +26,23 @@ export default class Stats extends Component {
}
return
(
<
ScrollView
>
<
View
>
<
View
style
=
{
styles
.
appHorizontalMargin
}
>
<
AppText
style
=
{
styles
.
appTextTitle
}
>
{
labels
.
cycleLengthTitle
}
<
/AppText
>
<
AppText
style
=
{
styles
.
appBottomMargin
}
>
{
labels
.
cycleLengthExplainer
}
<
/AppText
>
{
!
atLeastOneCycle
&&
<
AppText
style
=
{
styles
.
statsIntro
}
>
{
labels
.
emptyStats
}
<
/AppText
>
<
AppText
>
{
labels
.
emptyStats
}
<
/AppText
>
}
{
atLeastOneCycle
&&
numberOfCycles
===
1
&&
<
AppText
style
=
{
styles
.
statsIntro
}
>
{
labels
.
oneCycleStats
(
cycleLengths
[
0
])}
<
AppText
>
{
labels
.
oneCycleStats
}
<
AppText
style
=
{
styles
.
appTextEmphasis
}
>
{
cycleLengths
[
0
]}
<
/AppText
>
{
labels
.
daysLabel
+
'
.
'
}
<
/AppText
>
}
{
atLeastOneCycle
&&
numberOfCycles
>
1
&&
<
View
>
<
AppText
style
=
{
styles
.
statsIntro
}
>
{
labels
.
getBasisOfStats
(
numberOfCycles
)}
<
/AppText
>
<
View
style
=
{
styles
.
statsRow
}
>
<
AppText
style
=
{
styles
.
statsLabelLeft
}
>
{
labels
.
averageLabel
}
<
/AppText
>
<
AppText
style
=
{
styles
.
statsLabelRight
}
>
{
cycleInfo
.
mean
+
'
'
+
labels
.
daysLabel
}
<
/AppText
>
<
AppText
style
=
{
[
styles
.
statsLabelLeft
,
styles
.
appTextEmphasis
]
}
>
{
labels
.
averageLabel
}
<
/AppText
>
<
AppText
style
=
{
[
styles
.
statsLabelRight
,
styles
.
appTextEmphasis
]
}
>
{
cycleInfo
.
mean
+
'
'
+
labels
.
daysLabel
}
<
/AppText
>
<
/View
>
<
View
style
=
{
styles
.
statsRow
}
>
<
AppText
style
=
{
styles
.
statsLabelLeft
}
>
{
labels
.
minLabel
}
<
/AppText
>
...
...
@@ -51,10 +52,15 @@ export default class Stats extends Component {
<
AppText
style
=
{
styles
.
statsLabelLeft
}
>
{
labels
.
maxLabel
}
<
/AppText
>
<
AppText
style
=
{
styles
.
statsLabelRight
}
>
{
cycleInfo
.
maximum
+
'
'
+
labels
.
daysLabel
}
<
/AppText
>
<
/View
>
<
View
style
=
{
styles
.
statsRow
}
>
<
View
style
=
{
[
styles
.
statsRow
,
styles
.
appBottomMargin
]
}
>
<
AppText
style
=
{
styles
.
statsLabelLeft
}
>
{
labels
.
stdLabel
}
<
/AppText
>
<
AppText
style
=
{
styles
.
statsLabelRight
}
>
{
cycleInfo
.
stdDeviation
+
'
'
+
labels
.
daysLabel
}
<
/AppText
>
<
/View
>
<
AppText
>
{
labels
.
basisOfStatsBeginning
}
<
AppText
style
=
{
styles
.
appTextEmphasis
}
>
{
numberOfCycles
}
<
/AppText
>
{
labels
.
basisOfStatsEnd
}
<
/AppText
>
<
/View>
}
<
/View
>
<
/ScrollView
>
...
...
This diff is collapsed.
Click to expand it.
styles/index.js
+
16
−
4
View file @
e9ebde91
...
...
@@ -8,6 +8,20 @@ export default StyleSheet.create({
appText
:
{
color
:
'
black
'
},
appTextEmphasis
:
{
fontWeight
:
'
bold
'
,
},
appTextTitle
:
{
fontSize
:
18
,
color
:
'
black
'
,
marginBottom
:
5
,
},
appHorizontalMargin
:
{
marginHorizontal
:
10
,
},
appBottomMargin
:
{
marginBottom
:
5
},
welcome
:
{
fontSize
:
20
,
margin
:
30
,
...
...
@@ -137,12 +151,12 @@ export default StyleSheet.create({
symptomEditButton
:
{
width
:
130
},
statsIntro
:
{
/*
statsIntro: {
fontSize: 18,
margin: 10,
textAlign: 'left',
textAlignVertical: 'center'
},
},
*/
settingsSegment
:
{
backgroundColor
:
'
lightgrey
'
,
padding
:
10
,
...
...
@@ -165,14 +179,12 @@ export default StyleSheet.create({
width
:
'
100%
'
},
statsLabelLeft
:
{
fontSize
:
18
,
width
:
'
60%
'
,
textAlign
:
'
left
'
,
textAlignVertical
:
'
center
'
,
marginLeft
:
10
},
statsLabelRight
:
{
fontSize
:
18
,
textAlign
:
'
left
'
,
textAlignVertical
:
'
center
'
},
...
...
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