From 37933ea60b0938090dbe3db91b396ebe6b24541c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20=C3=96sterlund?= Date: Mon, 12 Aug 2024 21:19:23 +0200 Subject: [PATCH 1/3] edit docs for interactive event modal --- components/pages/landing-page.tsx | 2 +- .../pages/validate-license-key.module.scss | 4 +- components/pages/validate-license-key.tsx | 14 ++- components/partials/sales-card/checkmark.tsx | 6 +- pages/changelog.mdx | 21 ++++ pages/docs/interactive-event-modal.mdx | 113 ++++++++++-------- theme.config.tsx | 12 +- 7 files changed, 111 insertions(+), 61 deletions(-) diff --git a/components/pages/landing-page.tsx b/components/pages/landing-page.tsx index a118691..c6924aa 100644 --- a/components/pages/landing-page.tsx +++ b/components/pages/landing-page.tsx @@ -81,7 +81,7 @@ export default function LandingPage() { - + diff --git a/components/pages/validate-license-key.module.scss b/components/pages/validate-license-key.module.scss index a8ebbbe..45c3f78 100644 --- a/components/pages/validate-license-key.module.scss +++ b/components/pages/validate-license-key.module.scss @@ -19,10 +19,10 @@ } button { - background-color: #007bff; + background-color: var(--sx-color-primary); color: #fff; border: none; - border-radius: 0.25rem; + border-radius: var(--sx-rounding-small); padding: 0.5rem 1rem; font-size: 1rem; cursor: pointer; diff --git a/components/pages/validate-license-key.tsx b/components/pages/validate-license-key.tsx index c195f4e..06fd2bf 100644 --- a/components/pages/validate-license-key.tsx +++ b/components/pages/validate-license-key.tsx @@ -36,11 +36,11 @@ export default function ValidateLicenseKeyPage() { {!isLoading && !accessToken && !hasError && (

- Validate your license key + Validate your license key 🔑

- Enter your license key to validate it. If we can validate your key, you will get an access token for the + Enter your license key to validate it. In return, you will get an access token for the Schedule-X private registry. If you run into any problems, please contact us at tom@schedule-x.dev.

@@ -62,7 +62,7 @@ export default function ValidateLicenseKeyPage() { {accessToken && (

- Your access token + Your access token ✅

Your access token is: {accessToken} @@ -74,7 +74,13 @@ export default function ValidateLicenseKeyPage() { )} {hasError && ( -

There was an error validating your license key. Please try again or contact us at tom@schedule-x.dev, and we will get in touch as soon as possible.

+ <> +

+ Something went wrong 🤔 +

+ +

There was an error validating your license key. Please try again or contact us at tom@schedule-x.dev, and we will get in touch as soon as possible.

+ )} diff --git a/components/partials/sales-card/checkmark.tsx b/components/partials/sales-card/checkmark.tsx index 69f772d..e2cb45d 100644 --- a/components/partials/sales-card/checkmark.tsx +++ b/components/partials/sales-card/checkmark.tsx @@ -1,8 +1,12 @@ export default function AppCheckmark() { const green = '#7fbb46' + const svgStyles = { + minWidth: '18px', + width: '18px', + } return <> - { + console.log(event) + }, + + // (Optional): callback for when an event is updated + onDeleteEvent: (eventId) => { + console.log(eventId) + }, + + // (Optional): callback for when an event start property is updated + onStartUpdate(start) { + console.log(start) + }, + + // (Optional): callback for when an event end property is updated + onEndUpdate(end) { + console.log(end) + }, + + // (Optional): callback which is invoked before opening the modal. Return false to prevent the modal from opening + canOpenModal: (event) => { + return event.calendarId === 'calendar-1'; + }, + + // (Optional): configure the time picker to use 12-hour format + has12HourTimeFormat: true, + + // (Optional): configuration for the field "title" + fields: { + title: { + label: 'Event Title', + name: 'event-title', + validator: (value) => { + return { + isValid: !!value && value.length >= 3, + message: 'Title must be at least 3 characters long' + } + } + }, + description: {}, + } +}) + const calendar = createCalendar({ // ...other configuration plugins: [ - createInteractiveEventModal({ - // dependency needed to add events - eventsService, - - // (Optional): Available people for the event form - availablePeople: ['John Doe', 'Jane Doe'], - - // (Optional): callback for when an event is added - onAddEvent: (event) => { - console.log(event) - }, - - // (Optional): callback for when an event is updated - onDeleteEvent: (eventId) => { - console.log(eventId) - }, - - // (Optional): callback for when an event start property is updated - onStartUpdate(start) { - console.log(start) - }, - - // (Optional): callback for when an event end property is updated - onEndUpdate(end) { - console.log(end) - }, - - // (Optional): callback which is invoked before opening the modal. Return false to prevent the modal from opening - canOpenModal: (event) => { - return event.calendarId === 'calendar-1'; - }, - - // (Optional): configure the time picker to use 12-hour format - has12HourTimeFormat: true, - - // (Optional): configuration for the field "title" - fields: { - title: { - label: 'Event Title', - name: 'event-title', - validator: (value) => { - return { - isValid: !!value && value.length >= 3, - message: 'Title must be at least 3 characters long' - } - } - }, - description: {}, - } - }) - ] + eventModal, + eventsService, + ], + + callbacks: { + onDoubleClickDateTime(dateTime) { + eventModal.clickToCreate(dateTime, { + id: 'some-event-id', + }) + } + } }) calendar.render(document.getElementById('your-calendar-wrapper')) diff --git a/theme.config.tsx b/theme.config.tsx index 124a80b..9c83a5a 100644 --- a/theme.config.tsx +++ b/theme.config.tsx @@ -13,11 +13,19 @@ const config: DocsThemeConfig = { chat: { link: 'https://discord.gg/yHbT3C4M8w', }, - docsRepositoryBase: - 'https://github.com/schedule-x/schedule-x/tree/main/website', footer: { component: CustomFooter, }, + editLink: { + component: () => { + return <> + } + }, + feedback: { + content: () => { + return <> + } + }, darkMode: false, useNextSeoProps() { const { asPath } = useRouter() From 6c4634fb39eec52306125029761907ae341f9a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20=C3=96sterlund?= Date: Mon, 12 Aug 2024 21:27:28 +0200 Subject: [PATCH 2/3] edit docs for interactive event modal --- pages/changelog.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/changelog.mdx b/pages/changelog.mdx index 39d3844..851f5d0 100644 --- a/pages/changelog.mdx +++ b/pages/changelog.mdx @@ -21,7 +21,7 @@ * add resource view beta * **resource-view:** add resource color icons -# 0.15.0(2024-07-31) +## 0.15.0(2024-07-31) ### Features From 5c10f46ea61624596b91720127ccdc0e59f4ba98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20=C3=96sterlund?= Date: Mon, 12 Aug 2024 21:27:51 +0200 Subject: [PATCH 3/3] edit docs for interactive event modal --- pages/changelog.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/changelog.mdx b/pages/changelog.mdx index 851f5d0..a499aa6 100644 --- a/pages/changelog.mdx +++ b/pages/changelog.mdx @@ -7,7 +7,7 @@ * **drag-to-create:** remove event listeners in month-grid when adding new event -# 0.16.0 (2024-08-08) +## 0.16.0 (2024-08-08) ### Bug Fixes