Fixes weekStart & automatic theme adjust checkbox (#847)
This commit is contained in:
parent
1662c9cf91
commit
89e5da15df
4 changed files with 6 additions and 5 deletions
components/booking/pages
pages
server/routers
|
@ -194,7 +194,7 @@ const AvailabilityPage = ({ profile, eventType, workingHours }: Props) => {
|
|||
periodCountCalendarDays={eventType?.periodCountCalendarDays}
|
||||
onDatePicked={changeDate}
|
||||
workingHours={workingHours}
|
||||
weekStart="Sunday"
|
||||
weekStart={profile.weekStart || "Sunday"}
|
||||
eventLength={eventType.length}
|
||||
minimumBookingNotice={eventType.minimumBookingNotice}
|
||||
/>
|
||||
|
|
|
@ -182,6 +182,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
|||
image: user.avatar,
|
||||
slug: user.username,
|
||||
theme: user.theme,
|
||||
weekStart: user.weekStart,
|
||||
},
|
||||
date: dateParam,
|
||||
eventType: eventTypeObject,
|
||||
|
|
|
@ -5,7 +5,7 @@ import { RefObject, useEffect, useRef, useState } from "react";
|
|||
import Select from "react-select";
|
||||
import TimezoneSelect from "react-timezone-select";
|
||||
|
||||
import { asStringOrUndefined } from "@lib/asStringOrNull";
|
||||
import { asStringOrNull, asStringOrUndefined } from "@lib/asStringOrNull";
|
||||
import { getSession } from "@lib/auth";
|
||||
import { extractLocaleInfo, localeLabels, localeOptions, OptionType } from "@lib/core/i18n/i18n.utils";
|
||||
import { useLocale } from "@lib/hooks/useLocale";
|
||||
|
@ -155,7 +155,7 @@ export default function Settings(props: Props) {
|
|||
timeZone: enteredTimeZone,
|
||||
weekStart: asStringOrUndefined(enteredWeekStartDay),
|
||||
hideBranding: enteredHideBranding,
|
||||
theme: asStringOrUndefined(selectedTheme?.value),
|
||||
theme: asStringOrNull(selectedTheme?.value),
|
||||
locale: enteredLanguage,
|
||||
})
|
||||
.then(() => {
|
||||
|
@ -310,7 +310,7 @@ export default function Settings(props: Props) {
|
|||
name="theme-adjust-os"
|
||||
type="checkbox"
|
||||
onChange={(e) => setSelectedTheme(e.target.checked ? null : themeOptions[0])}
|
||||
defaultChecked={!selectedTheme}
|
||||
checked={!selectedTheme}
|
||||
className="focus:ring-neutral-500 h-4 w-4 text-neutral-900 border-gray-300 rounded-sm"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -100,7 +100,7 @@ export const viewerRouter = createProtectedRouter()
|
|||
timeZone: z.string().optional(),
|
||||
weekStart: z.string().optional(),
|
||||
hideBranding: z.boolean().optional(),
|
||||
theme: z.string().optional(),
|
||||
theme: z.string().optional().nullable(),
|
||||
completedOnboarding: z.boolean().optional(),
|
||||
locale: z.string().optional(),
|
||||
}),
|
||||
|
|
Loading…
Reference in a new issue