calcom/components/ui/form/MinutesField.tsx
Syed Ali Shahbaz d8b3c42c28
Improvement/cal 639 turn edit location dialog into radix uu (#1055)
* replaced disclosure with collapsible

* added radix radio-group

* removed radix-UI radio group

* more fix

* --WIP

* --WIP

* react-hook-formify --WIP

* radix ui radio replaces headless ui radio

* further fixes --WIP

* --WIP

* form handling and availability wrapping

* minuteField fix

* availability fix

* fixed react-select menu overflow in dialog

* --WIP

* added default value for custom inputs

* fixed locations

* fixed daterangepicker

* fixed team eventType

* basic cleanup --wip

* fixed locations removal bug

* removed old locations state remnants

* some cleanup --wip

* rebase conflict resolution

* removed debug rem and fixed radio text size

* further requested changes

Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
Co-authored-by: Omar López <zomars@me.com>
2021-11-24 10:07:49 -07:00

36 lines
1.1 KiB
TypeScript

import React, { forwardRef, InputHTMLAttributes, ReactNode } from "react";
type Props = InputHTMLAttributes<HTMLInputElement> & {
label: ReactNode;
};
const MinutesField = forwardRef<HTMLInputElement, Props>(({ label, ...rest }, ref) => {
return (
<div className="block sm:flex">
<div className="mb-4 min-w-48 sm:mb-0">
<label htmlFor={rest.id} className="flex items-center h-full text-sm font-medium text-neutral-700">
{label}
</label>
</div>
<div className="w-full">
<div className="relative rounded-sm shadow-sm">
<input
{...rest}
ref={ref}
type="number"
className="block w-full pl-2 pr-12 border-gray-300 rounded-sm focus:ring-primary-500 focus:border-primary-500 sm:text-sm"
/>
<div className="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none">
<span className="text-gray-500 sm:text-sm" id="duration">
mins
</span>
</div>
</div>
</div>
</div>
);
});
MinutesField.displayName = "MinutesField";
export default MinutesField;