diff --git a/components/calendar.tsx b/components/calendar.tsx
index 8759cda..703d322 100644
--- a/components/calendar.tsx
+++ b/components/calendar.tsx
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
-import cx from 'classnames'
+import classnames from 'classnames'
import useSWR from 'swr'
import moment from 'moment'
import { Calendar } from 'react-calendar-component'
@@ -29,15 +29,17 @@ export default function MyCalendar() {
}
return (
- <>
-
Buchungsübersicht
+
+
Buchungsübersicht
setDate(date)}
+ onChangeMonth={(date: React.SetStateAction) =>
+ setDate(date)
+ }
date={date}
renderDay={({ day, classNames, onPickDate }) => (
)
}
diff --git a/styles/index.css b/styles/index.css
index e97b764..e457082 100644
--- a/styles/index.css
+++ b/styles/index.css
@@ -111,61 +111,41 @@
}
.Calendar-grid {
- display: flex;
- flex-wrap: wrap;
- width: 100%;
+ @apply flex flex-wrap;
}
.Calendar-header {
- height: 50px;
- background: #333;
- color: #fff;
- text-align: center;
- line-height: 50px;
- display: flex;
- font-size: 20px;
- justify-content: space-between;
+ @apply flex justify-between bg-gray-700 text-gray-200 text-center;
}
.Calendar-header button {
- width: 50px;
- font-size: 20px;
- border: 0;
- background: transparent;
- color: #ddd;
- cursor: pointer;
+ @apply w-10 bg-transparent text-gray-200 cursor-pointer;
}
.Calendar-grid-item {
- flex: 0 14.28571%;
- text-align: center;
- border-right: 1px solid #ddd;
- border-bottom: 1px solid #ddd;
- padding: 1rem;
- display: flex;
- flex-direction: column;
- justify-content: center;
+ @apply text-center p-1 bg-green-200 border-r border-b border-solid border-gray-500;
+ flex: 0 calc(100% / 7);
}
.Calendar-grid-item--current {
- font-weight: 700;
+ @apply font-bold;
}
.Calendar-grid-item--booked {
- @apply bg-red-300;
+ @apply bg-red-200 cursor-not-allowed;
}
.Calendar-grid-item.nextMonth,
.Calendar-grid-item.prevMonth {
- color: #999;
+ @apply text-gray-500;
}
.Calendar-grid-item:nth-child(7n + 1) {
- border-left: 1px solid #ddd;
+ @apply border-l;
}
.Calendar-grid-item:nth-child(-n + 7) {
- border-top: 1px solid #ddd;
+ @apply border-t;
}
/* Start purging... */