
* Refactored Schedule component * Merge branch 'main' into feature/availability-page-revamp * wip * Turned value into number, many other TS tweaks * NodeJS 16x works 100% on my local, but out of scope for this already massive PR * Fixed TS errors in viewer.tsx and schedule/index.ts * Reverted next.config.js * Fixed minor remnant from moving types to @lib/types * schema comment * some changes to form handling * add comments * Turned ConfigType into number; which seems to be the value preferred by tRPC * Fixed localized time display during onboarding * Update components/ui/form/Schedule.tsx Co-authored-by: Alex Johansson <alexander@n1s.se> * Added showToast to indicate save success * Converted number to Date, and also always establish time based on current date * prevent height flickering of availability by removing mb-2 of input field * availabilty: re-added mb-2 but added min-height * Quite a few bugs discovered, but this seems functional Co-authored-by: KATT <alexander@n1s.se> Co-authored-by: Bailey Pumfleet <pumfleet@hey.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Peer Richelsen <peeroke@gmail.com>
33 lines
908 B
TypeScript
33 lines
908 B
TypeScript
import React from "react";
|
|
import ReactSelect, { components, GroupBase, Props } from "react-select";
|
|
|
|
import classNames from "@lib/classNames";
|
|
|
|
function Select<
|
|
Option,
|
|
IsMulti extends boolean = false,
|
|
Group extends GroupBase<Option> = GroupBase<Option>
|
|
>({ className, ...props }: Props<Option, IsMulti, Group>) {
|
|
return (
|
|
<ReactSelect
|
|
theme={(theme) => ({
|
|
...theme,
|
|
borderRadius: 2,
|
|
colors: {
|
|
...theme.colors,
|
|
primary: "rgba(17, 17, 17, var(--tw-bg-opacity))",
|
|
primary50: "rgba(17, 17, 17, var(--tw-bg-opacity))",
|
|
primary25: "rgba(244, 245, 246, var(--tw-bg-opacity))",
|
|
},
|
|
})}
|
|
components={{
|
|
...components,
|
|
IndicatorSeparator: () => null,
|
|
}}
|
|
className={classNames("text-sm shadow-sm focus:border-primary-500", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default Select;
|