diff --git a/fittrackee_client/src/components/App.css b/fittrackee_client/src/components/App.css index 82490c71..42d54563 100644 --- a/fittrackee_client/src/components/App.css +++ b/fittrackee_client/src/components/App.css @@ -248,6 +248,13 @@ label { .custom-fa-small { font-size: 0.8em; + margin-left: -0.8em; +} + +@media only screen and (max-width: 992px) { + .custom-fa-small { + font-size: 0.6em; + } } .custom-tooltip { @@ -545,7 +552,6 @@ label { position: relative; height: 3em; border-right: 1px solid var(--border-color); - overflow: hidden; background: var(--neutral-color); } @@ -598,3 +604,74 @@ label { .calendar .body .weekend { background: #f5f5f5; } + +.calendar-activity, +.calendar-more { + display: none; +} + +.calendar-more { + color: #405976; + font-size: .7em; + margin-left: 0.3em; +} + +.calendar-display-more { + background: whitesmoke; + border-radius: 4px; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + margin-bottom: 10px; + padding: 10px 15px; + position: absolute; + min-width: 52px; + z-index: 1000; +} + +.calendar-activity-more { + display: none; +} + +@media only screen and (max-width: 992px) { + + .calendar-activity:nth-child(-n+2) { + display: inline-block; + } + + .calendar-activity:nth-child(n+3) ~ .calendar-more { + display: inline-block; + } + + .calendar-activity-more:nth-child(n+3){ + display: inline-block; + } +} + +@media only screen and (min-width: 992px) and (max-width: 1200px) { + + .calendar-activity:nth-child(-n+4){ + display: inline-block; + } + + .calendar-activity:nth-child(n+5) ~ .calendar-more { + display: inline-block; + } + + .calendar-activity-more:nth-child(n+5){ + display: inline-block; + } +} + +@media only screen and (min-width: 1200px) { + + .calendar-activity:nth-child(-n+6) { + display: inline-block; + } + + .calendar-activity:nth-child(n+7) ~ .calendar-more { + display: inline-block; + } + + .calendar-activity-more:nth-child(n+7){ + display: inline-block; + } +} diff --git a/fittrackee_client/src/components/Dashboard/Calendar.jsx b/fittrackee_client/src/components/Dashboard/Calendar.jsx index 3109620d..3660485c 100644 --- a/fittrackee_client/src/components/Dashboard/Calendar.jsx +++ b/fittrackee_client/src/components/Dashboard/Calendar.jsx @@ -13,13 +13,12 @@ import { subMonths, } from 'date-fns' import { enGB, fr } from 'date-fns/locale' -import React, { Fragment } from 'react' +import React from 'react' import { connect } from 'react-redux' -import { Link } from 'react-router-dom' +import CalendarActivities from './CalendarActivities' import { getMonthActivities } from '../../actions/activities' import { getDateWithTZ } from '../../utils' -import { recordsLabels } from '../../utils/activities' const getStartAndEndMonth = (date, weekStartOnMonday) => { const monthStart = startOfMonth(date) @@ -114,36 +113,11 @@ class Calendar extends React.Component {