Added booking tabs, type fixing and refactoring (#825)
* More type fixes * More type fixes * Type fixes * Adds inputMode to email fields * Added booking tabs * Adds aditional notes to bookings
This commit is contained in:
1 parent
5318047794
commit
a04336ba06
29 files changed
+609
-519
No files matched your search
@@ -1,21 +1,26 @@
|
||||
import { XIcon, CheckIcon } from "@heroicons/react/outline";
|
||||
import { CheckIcon, XIcon } from "@heroicons/react/outline";
|
||||
import React, { ForwardedRef, useEffect, useState } from "react";
|
||||
import { OptionsType } from "react-select/lib/types";
|
||||
|
||||
import Avatar from "@components/ui/Avatar";
|
||||
import Select from "@components/ui/form/Select";
|
||||
|
||||
type CheckedSelectValue = {
|
||||
avatar: string;
|
||||
label: string;
|
||||
value: string;
|
||||
}[];
|
||||
|
||||
export type CheckedSelectProps = {
|
||||
defaultValue?: [];
|
||||
defaultValue?: CheckedSelectValue;
|
||||
placeholder?: string;
|
||||
name?: string;
|
||||
options: [];
|
||||
onChange: (options: OptionsType) => void;
|
||||
disabled: [];
|
||||
options: CheckedSelectValue;
|
||||
onChange: (options: CheckedSelectValue) => void;
|
||||
disabled: boolean;
|
||||
};
|
||||
|
||||
export const CheckedSelect = React.forwardRef((props: CheckedSelectProps, ref: ForwardedRef<unknown>) => {
|
||||
const [selectedOptions, setSelectedOptions] = useState<[]>(props.defaultValue || []);
|
||||
const [selectedOptions, setSelectedOptions] = useState<CheckedSelectValue>(props.defaultValue || []);
|
||||
|
||||
useEffect(() => {
|
||||
props.onChange(selectedOptions);
|
||||
@@ -38,7 +43,7 @@ export const CheckedSelect = React.forwardRef((props: CheckedSelectProps, ref: F
|
||||
disabled: !!selectedOptions.find((selectedOption) => selectedOption.value === option.value),
|
||||
}));
|
||||
|
||||
const removeOption = (value) =>
|
||||
const removeOption = (value: string) =>
|
||||
setSelectedOptions(selectedOptions.filter((option) => option.value !== value));
|
||||
|
||||
const changeHandler = (selections) =>
|
||||
|
||||
@@ -6,8 +6,8 @@ import React from "react";
|
||||
import "react-calendar/dist/Calendar.css";
|
||||
|
||||
type Props = {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
onDatesChange?: ((arg: { startDate: Date; endDate: Date }) => void) | undefined;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export const SelectComp = (props: PropsWithChildren<NamedProps>) => (
|
||||
<Select
|
||||
theme={(theme) => ({
|
||||
...theme,
|
||||
borderRadius: "2px",
|
||||
borderRadius: 2,
|
||||
colors: {
|
||||
...theme.colors,
|
||||
primary: "rgba(17, 17, 17, var(--tw-bg-opacity))",
|
||||
|
||||
Reference in new issue
Block a user