style: create project modal (#1628)

* style: create project modal

* fix: build error

* fix: modal width
This commit is contained in:
Aaryan Khandelwal 2023-07-23 22:14:26 +05:30 committed by GitHub
parent ccbcfecc6d
commit a7b5ad55ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 273 additions and 191 deletions

View file

@ -10,17 +10,21 @@ import { DropdownProps } from "./types";
export type CustomSearchSelectProps = DropdownProps & {
footerOption?: JSX.Element;
multiple?: boolean;
value: any;
onChange: any;
options:
| {
value: any;
query: string;
content: JSX.Element;
content: React.ReactNode;
}[]
| undefined;
};
} & (
| { multiple?: false; value: any } // if multiple is false, value can be anything
| {
multiple?: true;
value: any[]; // if multiple is true, value should be an array
}
);
export const CustomSearchSelect = ({
buttonClassName = "",
@ -103,7 +107,7 @@ export const CustomSearchSelect = ({
<div className="flex w-full items-center justify-start rounded-sm border-[0.6px] border-custom-border-200 bg-custom-background-90 px-2">
<MagnifyingGlassIcon className="h-3 w-3 text-custom-text-200" />
<Combobox.Input
className="w-full bg-transparent py-1 px-2 text-xs text-custom-text-200 focus:outline-none"
className="w-full bg-transparent py-1 px-2 text-xs text-custom-text-200 placeholder:text-custom-text-400 focus:outline-none"
onChange={(e) => setQuery(e.target.value)}
placeholder="Type to search..."
displayValue={(assigned: any) => assigned?.name}

View file

@ -89,7 +89,7 @@ const CustomSelect = ({
);
type OptionProps = {
children: string | JSX.Element;
children: React.ReactNode;
value: any;
className?: string;
};

View file

@ -4,7 +4,7 @@ import React, { useState, useRef, useEffect } from "react";
import { Props } from "./types";
// Updates the height of a <textarea> when the value changes.
const useAutosizeTextArea = (textAreaRef: HTMLTextAreaElement | null, value: any) => {
const useAutoSizeTextArea = (textAreaRef: HTMLTextAreaElement | null, value: any) => {
useEffect(() => {
if (textAreaRef) {
// We need to reset the height momentarily to get the correct scrollHeight for the textarea
@ -40,7 +40,7 @@ export const TextArea: React.FC<Props> = ({
const textAreaRef = useRef<any>(null);
useAutosizeTextArea(textAreaRef.current, textareaValue);
useAutoSizeTextArea(textAreaRef.current, textareaValue);
return (
<>