
* Add vital integration * Tidy up client_user_id creation * Rename vital app to vitalother to follow name rules * Added env var * App vital reschedule * Fix on app structure and api calls * Implemented user identification from webhook * WIP fix api call and read me * Save vital settings via api * Now saving userVitalSettings and trigger reschedule on selected param * Added translations * Fix type for vitalSettings * Using api to get env vars required for url, fix display of vital settings * Fix hours placeholder, translation not working * Renames vital app * Update seed-app-store.ts * Update package.json * Update yarn.lock * Refactored env variables * Update README.md * Migrates to api_keys * Extracts AppConfiguration * vitalClient fixes * Update index.ts * Update metadata.ts * Update index.ts * Update metadata.ts * Added namespace vital for translations Co-authored-by: Maitham <maithamdib@gmail.com> Co-authored-by: zomars <zomars@me.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
63 lines
1.8 KiB
TypeScript
63 lines
1.8 KiB
TypeScript
import ReactSelect, { components, GroupBase, InputProps, Props } from "react-select";
|
|
|
|
import classNames from "@calcom/lib/classNames";
|
|
|
|
export type SelectProps<
|
|
Option,
|
|
IsMulti extends boolean = false,
|
|
Group extends GroupBase<Option> = GroupBase<Option>
|
|
> = Props<Option, IsMulti, Group>;
|
|
|
|
export const InputComponent = <Option, IsMulti extends boolean, Group extends GroupBase<Option>>({
|
|
inputClassName,
|
|
...props
|
|
}: InputProps<Option, IsMulti, Group>) => {
|
|
return (
|
|
<components.Input
|
|
// disables our default form focus hightlight on the react-select input element
|
|
inputClassName={classNames("focus:ring-0 focus:ring-offset-0", inputClassName)}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
function Select<
|
|
Option,
|
|
IsMulti extends boolean = false,
|
|
Group extends GroupBase<Option> = GroupBase<Option>
|
|
>({ className, ...props }: SelectProps<Option, IsMulti, Group>) {
|
|
return (
|
|
<ReactSelect
|
|
theme={(theme) => ({
|
|
...theme,
|
|
borderRadius: 2,
|
|
colors: {
|
|
...theme.colors,
|
|
primary: "var(--brand-color)",
|
|
|
|
primary50: "rgba(209 , 213, 219, var(--tw-bg-opacity))",
|
|
primary25: "rgba(244, 245, 246, var(--tw-bg-opacity))",
|
|
},
|
|
})}
|
|
styles={{
|
|
option: (provided, state) => ({
|
|
...provided,
|
|
color: state.isSelected ? "var(--brand-text-color)" : "black",
|
|
":active": {
|
|
backgroundColor: state.isSelected ? "" : "var(--brand-color)",
|
|
color: "var(--brand-text-color)",
|
|
},
|
|
}),
|
|
}}
|
|
components={{
|
|
...components,
|
|
IndicatorSeparator: () => null,
|
|
Input: InputComponent,
|
|
}}
|
|
className={classNames("text-sm shadow-sm", className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export default Select;
|