-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
it already reacts to change in header's time-selector
- Loading branch information
Showing
3 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import work from "./assets/images/icon-work.svg"; | ||
import play from "./assets/images/icon-play.svg"; | ||
import study from "./assets/images/icon-study.svg"; | ||
import exercise from "./assets/images/icon-exercise.svg"; | ||
import social from "./assets/images/icon-social.svg"; | ||
import selfCare from "./assets/images/icon-self-care.svg"; | ||
|
||
export default { | ||
Work: work, | ||
Play: play, | ||
Study: study, | ||
Exercise: exercise, | ||
Social: social, | ||
"Self Care": selfCare, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,45 @@ | ||
import "./MainBody.css"; | ||
import data from "./assets/data.json"; | ||
import Icons from "./IconIndex"; | ||
import ellipsis from "./assets/images/icon-ellipsis.svg"; | ||
|
||
export default function (props) { | ||
const selectedTime = props.time; | ||
const lyToNormal = { | ||
// this is used to convert daily to weekly etc | ||
daily: "day", | ||
weekly: "week", | ||
monthly: "month", | ||
}; | ||
|
||
export default function () { | ||
return ( | ||
<main> | ||
<div></div> | ||
{data.map((value, index) => ( | ||
<div className="activity" key={index}> | ||
<div className="activity__icon"> | ||
<img src={Icons[value.title]} alt="" /> | ||
</div> | ||
|
||
<div className="activity__details"> | ||
<div className="activity__deatils__top"> | ||
<div className="activity__deatils__top__title">{value.title}</div> | ||
<div className="activity__deatils__top__menu"> | ||
<img src={ellipsis} alt="" /> | ||
</div> | ||
</div> | ||
|
||
<div className="activity__deatils__time"> | ||
<span className="activity__details__time__current"> | ||
{value.timeframes[selectedTime].current}hrs | ||
</span> | ||
<span className="activity__details__time__previous"> | ||
Last {lyToNormal[selectedTime]} - | ||
{value.timeframes[selectedTime].previous}hrs | ||
</span> | ||
</div> | ||
</div> | ||
</div> | ||
))} | ||
</main> | ||
); | ||
} |