| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277 |
- import styled from 'styled-components/macro';
- import theme from 'styled-theming';
- const StyledEventsCalendar = styled.div`
- .rbc-month-view,
- .rbc-time-view,
- .rbc-time-header {
- border: 1px solid var(--border);
- }
- .rbc-off-range-bg,
- .rbc-today {
- background: transparent;
- }
- .rbc-header {
- border-bottom: 1px solid var(--border);
- height: 40px;
- display: flex;
- align-items: center;
- justify-content: center;
- font-family: var(--heading-font);
- font-size: 10px;
- text-transform: uppercase;
- color: var(--header);
- font-weight: 600;
- button {
- font-weight: 600;
- }
- }
- .rbc-day-bg + .rbc-day-bg,
- .rbc-header + .rbc-header,
- .rbc-time-header-content,
- .rbc-time-content > * + * > * {
- border-left: 1px solid var(--border);
- }
- .rbc-time-content,
- .rbc-time-content:first-of-type {
- border-top: none;
- }
- .rbc-time-header.rbc-overflowing {
- border-right: 1px solid var(--border);
- }
- .rbc-month-row + .rbc-month-row {
- border-top: 1px solid var(--border);
- }
- .rbc-day-slot .rbc-time-slot {
- border-top: 1px dashed var(--border);
- }
- .rbc-timeslot-group {
- border-bottom: 1px dashed var(--border);
- position: relative;
- &:last-of-type {
- border-bottom: none;
- }
- }
- .rbc-current-time-indicator {
- background: ${theme('theme', {
- light: 'var(--azure)',
- dark: 'var(--accent)'
- })};
- }
- .rbc-time-gutter {
- width: 68px;
- .rbc-timeslot-group {
- .rbc-time-slot {
- &:first-of-type {
- flex: 1;
- align-items: center;
- justify-content: center;
- position: relative;
- &:before {
- content: '';
- position: absolute;
- top: 50%;
- left: 0;
- width: 100%;
- height: 1px;
- border-top: 1px dashed var(--border);
- transform: translateY(-50%);
- z-index: 1;
- }
- .rbc-label {
- position: relative;
- z-index: 2;
- font-family: var(--heading-font);
- font-size: 9px;
- letter-spacing: 0.45px;
- font-weight: 600;
- color: var(--btn-text);
- height: 20px;
- width: 40px;
- background: var(--widget);
- border-radius: 8px;
- display: flex;
- align-items: center;
- justify-content: center;
- line-height: 11px;
- }
- }
- &:last-of-type {
- display: none;
- }
- }
- }
- }
- &.day {
- .rbc-day-slot .rbc-timeslot-group:first-of-type .rbc-time-slot:first-of-type {
- border-top: none;
- }
- .rbc-time-header {
- display: none;
- }
- }
- &.week {
- .rbc-allday-cell,
- .rbc-current-time-indicator{
- display: none;
- }
- .rbc-time-header {
- border: none;
- }
- }
- &.month .rbc-month-view {
- min-height: 500px;
- .rbc-date-cell {
- padding: 4px 0 0 0;
- text-align: center;
- &.rbc-off-range {
- opacity: .5;
- }
- &.rbc-now .rbc-button-link {
- font-weight: 600;
- color: ${theme('theme', {
- light: 'var(--blue)',
- dark: 'var(--accent)'
- })};
- }
- .rbc-button-link {
- font-size: 0.75rem;
- font-family: var(--heading-font);
- font-weight: 500;
- }
- }
- // tablet portrait
- @media screen and (min-width: 768px) {
- min-height: 800px;
- .rbc-date-cell {
- text-align: right;
- padding: 10px;
- }
- }
- // desktop
- @media screen and (min-width: 1280px) {
- min-height: 1200px;
- }
- }
- .rbc-time-view {
- flex: unset;
- }
- .rbc-timeslot-group {
- max-height: 40px;
- .rbc-time-slot {
- display: flex;
- align-items: center;
- height: 20px;
- }
- }
- .rbc-events-container {
- margin: 0 !important;
- .rbc-event {
- padding: 0;
- background: transparent;
- border: none;
- border-radius: 0;
- &-label {
- display: none;
- }
- }
- }
- .rbc-event {
- padding: 0;
- background: transparent !important;
- border-radius: 0;
- outline: none !important;
- }
- .rbc-show-more {
- color: ${theme('theme', {
- light: 'var(--blue)',
- dark: 'var(--accent)'
- })};
- background: transparent;
- margin: 10px auto 0;
- }
- .rbc-row-segment {
- min-height: 20px;
- // desktop
- @media screen and (min-width: 1280px) {
- min-height: 40px;
- }
- }
- `;
- const Header = styled.div`
- margin-bottom: 20px;
- display: flex;
- flex-direction: column;
- gap: 20px;
- text-align: center;
- // tablet landscape
- @media screen and (min-width: 1024px) {
- flex-direction: row;
- align-items: center;
- justify-content: space-between;
-
- &[dir="ltr"] {
- &[data-view="day"] .date {
- margin-left: 68px;
- }
- }
- &[dir="rtl"] {
- &[data-view="day"] .date {
- margin-right: 68px;
- }
- }
- }
- `;
- const Navigation = styled.div`
- grid-template-columns: repeat(3, 1fr);
- width: 100%;
- // tablet landscape
- @media screen and (min-width: 1024px) {
- max-width: 300px;
- }
- `;
- export {StyledEventsCalendar, Navigation, Header}
|