Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ecolyo
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
Ecolyo
Commits
75870bce
Commit
75870bce
authored
4 years ago
by
Romain CREY
Browse files
Options
Downloads
Patches
Plain Diff
4 weeks challenge with daily progress
parent
1b546fbc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!28
Merge fix from dev
,
!27
Dev
,
!21
Features/us158 review design
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/ContentComponents/Challenge/FollowChallengeTimeline.tsx
+20
-80
20 additions, 80 deletions
...s/ContentComponents/Challenge/FollowChallengeTimeline.tsx
src/styles/components/_challenges.scss
+3
-0
3 additions, 0 deletions
src/styles/components/_challenges.scss
with
23 additions
and
80 deletions
src/components/ContentComponents/Challenge/FollowChallengeTimeline.tsx
+
20
−
80
View file @
75870bce
...
...
@@ -98,96 +98,36 @@ const FollowChallengeTimeline: React.FC<FollowChallengeTimelineViewProps> = ({
}
}
const
getListOfPastDaysStart
=
()
=>
{
if
(
Interval
.
fromDateTimes
(
challenge
&&
challenge
.
startingDate
,
DateTime
.
local
()
).
isValid
)
{
if
(
challenge
)
{
return
Interval
.
fromDateTimes
(
challenge
&&
challenge
.
startingDate
,
DateTime
.
local
()
).
count
(
'
days
'
)
}
else
{
return
0
}
}
else
{
if
(
challenge
)
{
return
-
Interval
.
fromDateTimes
(
DateTime
.
local
(),
challenge
&&
challenge
.
startingDate
).
count
(
'
days
'
)
}
else
{
return
0
}
}
const
generateDayDash
=
(
index
:
number
,
dayCount
:
number
)
=>
{
return
(
<
div
className
=
{
`date-dash
${
(
index
===
0
&&
dayCount
>
0
)
||
(
index
===
getListOfWeeks
().
length
-
1
&&
dayCount
<
0
)
?
'
none
'
:
index
*
7
<
getListOfPastDays
()
+
dayCount
?
'
past
'
:
'
futur
'
}
`
}
></
div
>
)
}
// const getListOfPastWeeks = () => {
// if (Interval.fromDateTimes(viewingDate(), DateTime.local()).isValid) {
// if (
// challenge &&
// challenge.challengeType &&
// challenge.challengeType.duration.days === 28
// ) {
// console.log(
// Interval.fromDateTimes(viewingDate(), DateTime.local()).count('days')
// )
// return (
// Interval.fromDateTimes(viewingDate(), DateTime.local()).count(
// 'days'
// ) / 7
// )
// } else {
// return 0
// }
// } else {
// return 0
// }
// }
const
monthChallenge
=
()
=>
{
return
getListOfWeeks
().
map
((
day
,
index
)
=>
(
<
div
key
=
{
index
}
className
=
"day-solo"
>
{
console
.
log
(
index
*
7
,
'
DAYS
'
,
getListOfPastDays
())
}
<
div
className
=
"day-line-label"
>
<
div
className
=
{
`date-dash
${
index
*
7
<=
getListOfPastDays
()
+
3
?
'
past
'
:
'
futur
'
}
`
}
></
div
>
<
div
className
=
{
`date-dash
${
index
*
7
<=
getListOfPastDays
()
+
2
?
'
past
'
:
'
futur
'
}
`
}
></
div
>
<
div
className
=
{
`date-dash
${
index
*
7
<=
getListOfPastDays
()
+
1
?
'
past
'
:
'
futur
'
}
`
}
></
div
>
{
generateDayDash
(
index
,
3
)
}
{
generateDayDash
(
index
,
2
)
}
{
generateDayDash
(
index
,
1
)
}
<
div
className
=
{
`date-label
${
index
*
7
<=
getListOfPastDays
()
?
'
past
'
:
'
futur
'
}
`
}
></
div
>
<
div
className
=
{
`date-dash
${
index
*
7
<=
getListOfPastDays
()
-
1
?
'
past
'
:
'
futur
'
}
`
}
></
div
>
<
div
className
=
{
`date-dash
${
index
*
7
<=
getListOfPastDays
()
-
2
?
'
past
'
:
'
futur
'
}
`
}
></
div
>
<
div
className
=
{
`date-dash
${
index
*
7
<=
getListOfPastDays
()
-
3
?
'
past
'
:
'
futur
'
index
*
7
<
getListOfPastDays
()
?
'
past
'
:
'
futur
'
}
`
}
></
div
>
{
generateDayDash
(
index
,
-
1
)
}
{
generateDayDash
(
index
,
-
2
)
}
{
generateDayDash
(
index
,
-
3
)
}
</
div
>
<
div
className
=
"day-letter"
>
{
day
.
letter
}
</
div
>
<
div
className
=
"day-date"
>
{
day
.
date
}
</
div
>
...
...
This diff is collapsed.
Click to expand it.
src/styles/components/_challenges.scss
+
3
−
0
View file @
75870bce
...
...
@@ -319,6 +319,9 @@
.futur
{
background-color
:
$grey-dark
;
}
.none
{
opacity
:
0
;
}
.date-label
{
width
:
0
.625rem
;
height
:
0
.625rem
;
...
...
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