chore: format all files in monorepo (#3054)

* chore: format all files in the project

* fix: removing @types/react from dependencies

* fix: adding prettier and eslint config

* chore: format files

* fix: upgrading turbo version

* chore: ignoring warnings and adding todos

* fix: updated the type of bubble menu item in the document editor

* chore: format files

---------

Co-authored-by: Aaryan Khandelwal <aaryankhandu123@gmail.com>
This commit is contained in:
sriram veeraghanta
2023-12-10 15:48:10 +05:30
committed by GitHub
parent 5eba682128
commit 8d15b9e7de
721 changed files with 3739 additions and 4660 deletions

View File

@@ -114,7 +114,7 @@ export const CreateLabelModal: React.FC<Props> = observer((props) => {
leaveFrom="opacity-100 translate-y-0 sm:scale-100"
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Panel className="relative transform rounded-lg bg-custom-background-100 px-4 pt-5 pb-4 text-left shadow-custom-shadow-md transition-all sm:my-8 sm:w-full sm:max-w-2xl sm:p-6">
<Dialog.Panel className="relative transform rounded-lg bg-custom-background-100 px-4 pb-4 pt-5 text-left shadow-custom-shadow-md transition-all sm:my-8 sm:w-full sm:max-w-2xl sm:p-6">
<form onSubmit={handleSubmit(onSubmit)}>
<div>
<Dialog.Title as="h3" className="text-lg font-medium leading-6 text-custom-text-100">
@@ -174,7 +174,7 @@ export const CreateLabelModal: React.FC<Props> = observer((props) => {
</>
)}
</Popover>
<div className="flex w-full flex-col gap-0.5 justify-center">
<div className="flex w-full flex-col justify-center gap-0.5">
<Controller
control={control}
name="name"
@@ -192,7 +192,7 @@ export const CreateLabelModal: React.FC<Props> = observer((props) => {
tabIndex={1}
hasError={Boolean(errors.name)}
placeholder="Label title"
className="resize-none text-xl w-full"
className="w-full resize-none text-xl"
/>
)}
/>

View File

@@ -128,7 +128,7 @@ export const CreateUpdateLabelInline = observer(
e.preventDefault();
handleSubmit(isUpdating ? handleLabelUpdate : handleLabelCreate)();
}}
className={`flex scroll-m-8 items-center gap-2 bg-custom-background-100 w-full ${labelForm ? "" : "hidden"}`}
className={`flex w-full scroll-m-8 items-center gap-2 bg-custom-background-100 ${labelForm ? "" : "hidden"}`}
>
<div className="flex-shrink-0">
<Popover className="relative z-10 flex h-full w-full items-center justify-center">
@@ -156,7 +156,7 @@ export const CreateUpdateLabelInline = observer(
leaveFrom="opacity-100 translate-y-0"
leaveTo="opacity-0 translate-y-1"
>
<Popover.Panel className="absolute top-full left-0 z-20 mt-3 w-screen max-w-xs px-2 sm:px-0">
<Popover.Panel className="absolute left-0 top-full z-20 mt-3 w-screen max-w-xs px-2 sm:px-0">
<Controller
name="color"
control={control}

View File

@@ -90,12 +90,12 @@ export const DeleteLabelModal: React.FC<Props> = observer((props) => {
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
>
<Dialog.Panel className="relative transform overflow-hidden rounded-lg bg-custom-background-100 text-left shadow-custom-shadow-md transition-all sm:my-8 sm:w-[40rem]">
<div className="px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div className="px-4 pb-4 pt-5 sm:p-6 sm:pb-4">
<div className="sm:flex sm:items-start">
<div className="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10">
<AlertTriangle className="h-6 w-6 text-red-600" aria-hidden="true" />
</div>
<div className="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<div className="mt-3 text-center sm:ml-4 sm:mt-0 sm:text-left">
<Dialog.Title as="h3" className="text-lg font-medium leading-6 text-custom-text-100">
Delete Label
</Dialog.Title>

View File

@@ -12,13 +12,13 @@ export const DragHandle = (props: IDragHandle) => {
return (
<button
type="button"
className={`rounded text-custom-sidebar-text-200 flex flex-shrink-0 mr-1 group-hover:opacity-100 ${
className={`mr-1 flex flex-shrink-0 rounded text-custom-sidebar-text-200 group-hover:opacity-100 ${
isDragging ? "opacity-100" : "opacity-0"
}`}
{...dragHandleProps}
>
<MoreVertical className="h-3.5 w-3.5 stroke-custom-text-400" />
<MoreVertical className="h-3.5 w-3.5 stroke-custom-text-400 -ml-5" />
<MoreVertical className="-ml-5 h-3.5 w-3.5 stroke-custom-text-400" />
</button>
);
};

View File

@@ -40,7 +40,7 @@ export const LabelItemBlock = (props: ILabelItemBlock) => {
useOutsideClickDetector(actionSectionRef, () => setIsMenuActive(false));
return (
<div className="flex items-center group">
<div className="group flex items-center">
<div className="flex items-center">
<DragHandle isDragging={isDragging} dragHandleProps={dragHandleProps} />
<LabelName color={label.color} name={label.name} isGroup={isLabelGroup ?? false} />
@@ -70,7 +70,7 @@ export const LabelItemBlock = (props: ILabelItemBlock) => {
{!isLabelGroup && (
<div className="py-0.5">
<button className="flex h-4 w-4 items-center justify-start gap-2" onClick={() => handleLabelDelete(label)}>
<X className="h-4 w-4 text-custom-sidebar-text-400 flex-shrink-0" />
<X className="h-4 w-4 flex-shrink-0 text-custom-sidebar-text-400" />
</button>
</div>
)}

View File

@@ -84,13 +84,13 @@ export const LabelSelect: React.FC<Props> = (props) => {
<button ref={setReferenceElement} type="button" className="h-full w-full">
{value.length > 0 ? (
value.length <= maxRender ? (
<div className="flex items-center gap-2 px-4 overflow-x-scroll">
<div className="flex items-center gap-2 overflow-x-scroll px-4">
{labels
?.filter((l) => value.includes(l.id))
.map((label) => (
<div
key={label.id}
className="flex items-center flex-shrink-0 rounded border-[0.5px] border-custom-border-300 px-2.5 py-1 text-xs h-full"
className="flex h-full flex-shrink-0 items-center rounded border-[0.5px] border-custom-border-300 px-2.5 py-1 text-xs"
>
<div className="flex items-center gap-1.5 text-custom-text-200">
<span
@@ -106,7 +106,7 @@ export const LabelSelect: React.FC<Props> = (props) => {
</div>
) : (
<div
className={`h-full flex items-center flex-shrink-0 rounded border-[0.5px] border-custom-border-300 px-4 text-xs ${buttonClassName}`}
className={`flex h-full flex-shrink-0 items-center rounded border-[0.5px] border-custom-border-300 px-4 text-xs ${buttonClassName}`}
>
<Tooltip
position="top"
@@ -116,7 +116,7 @@ export const LabelSelect: React.FC<Props> = (props) => {
.map((l) => l.name)
.join(", ")}
>
<div className="h-full flex items-center gap-1.5 text-custom-text-200">
<div className="flex h-full items-center gap-1.5 text-custom-text-200">
<span className="h-2 w-2 flex-shrink-0 rounded-full bg-custom-primary" />
{`${value.length} Labels`}
</div>
@@ -125,7 +125,7 @@ export const LabelSelect: React.FC<Props> = (props) => {
)
) : (
<div
className={`flex items-center justify-between gap-1 w-full text-xs px-4 ${
className={`flex w-full items-center justify-between gap-1 px-4 text-xs ${
disabled ? "cursor-not-allowed text-custom-text-200" : "cursor-pointer hover:bg-custom-background-80"
} ${buttonClassName}`}
>
@@ -138,7 +138,7 @@ export const LabelSelect: React.FC<Props> = (props) => {
<Combobox.Options>
<div
className={`z-10 border border-custom-border-300 px-2 py-2.5 rounded bg-custom-background-100 text-xs shadow-custom-shadow-rg focus:outline-none w-48 whitespace-nowrap my-1 ${optionsClassName}`}
className={`z-10 my-1 w-48 whitespace-nowrap rounded border border-custom-border-300 bg-custom-background-100 px-2 py-2.5 text-xs shadow-custom-shadow-rg focus:outline-none ${optionsClassName}`}
ref={setPopperElement}
style={styles.popper}
{...attributes.popper}
@@ -146,14 +146,14 @@ export const LabelSelect: React.FC<Props> = (props) => {
<div className="flex w-full items-center justify-start rounded border border-custom-border-200 bg-custom-background-90 px-2">
<Search className="h-3.5 w-3.5 text-custom-text-300" />
<Combobox.Input
className="w-full bg-transparent py-1 px-2 text-xs text-custom-text-200 placeholder:text-custom-text-400 focus:outline-none"
className="w-full bg-transparent px-2 py-1 text-xs text-custom-text-200 placeholder:text-custom-text-400 focus:outline-none"
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Search"
displayValue={(assigned: any) => assigned?.name}
/>
</div>
<div className={`mt-2 space-y-1 max-h-48 overflow-y-scroll`}>
<div className={`mt-2 max-h-48 space-y-1 overflow-y-scroll`}>
{filteredOptions ? (
filteredOptions.length > 0 ? (
filteredOptions.map((option) => (
@@ -161,7 +161,7 @@ export const LabelSelect: React.FC<Props> = (props) => {
key={option.value}
value={option.value}
className={({ active, selected }) =>
`flex items-center justify-between gap-2 cursor-pointer select-none truncate rounded px-1 py-1.5 ${
`flex cursor-pointer select-none items-center justify-between gap-2 truncate rounded px-1 py-1.5 ${
active ? "bg-custom-background-80" : ""
} ${selected ? "text-custom-text-100" : "text-custom-text-200"}`
}

View File

@@ -88,7 +88,7 @@ export const LabelsListModal: React.FC<Props> = observer((props) => {
<Combobox>
<div className="relative m-1">
<Search
className="pointer-events-none absolute top-3.5 left-4 h-5 w-5 text-custom-text-100 text-opacity-40"
className="pointer-events-none absolute left-4 top-3.5 h-5 w-5 text-custom-text-100 text-opacity-40"
aria-hidden="true"
/>
<Combobox.Input
@@ -102,7 +102,7 @@ export const LabelsListModal: React.FC<Props> = observer((props) => {
{filteredLabels.length > 0 && (
<li className="p-2">
{query === "" && (
<h2 className="mt-4 mb-2 px-3 text-xs font-semibold text-custom-text-100">Labels</h2>
<h2 className="mb-2 mt-4 px-3 text-xs font-semibold text-custom-text-100">Labels</h2>
)}
<ul className="text-sm text-gray-700">
{filteredLabels.map((label) => {
@@ -144,7 +144,7 @@ export const LabelsListModal: React.FC<Props> = observer((props) => {
</Combobox.Options>
{query !== "" && filteredLabels.length === 0 && (
<div className="py-14 px-6 text-center sm:px-14">
<div className="px-6 py-14 text-center sm:px-14">
<LayerStackIcon
className="mx-auto h-6 w-6 text-custom-text-100 text-opacity-40"
aria-hidden="true"

View File

@@ -128,9 +128,9 @@ export const ProjectSettingLabelGroup: React.FC<Props> = observer((props) => {
leaveTo="transform opacity-0"
>
<Disclosure.Panel>
<div className="mt-2.5 ml-6">
<div className="ml-6 mt-2.5">
{labelChildren.map((child, index) => (
<div key={child.id} className={`group w-full flex items-center text-sm`}>
<div key={child.id} className={`group flex w-full items-center text-sm`}>
<Draggable
draggableId={`label.draggable.${child.id}`}
index={index}

View File

@@ -62,9 +62,9 @@ export const ProjectSettingLabelItem: React.FC<Props> = (props) => {
return (
<div
className={`relative group flex items-center justify-between gap-2 space-y-3 rounded border-[0.5px] border-custom-border-200 ${
className={`group relative flex items-center justify-between gap-2 space-y-3 rounded border-[0.5px] border-custom-border-200 ${
!isChild && combineTargetFor ? "bg-custom-background-80" : ""
} ${isDragging ? "shadow-custom-shadow-xs bg-custom-background-80" : ""} bg-custom-background-100 px-1 py-2.5`}
} ${isDragging ? "bg-custom-background-80 shadow-custom-shadow-xs" : ""} bg-custom-background-100 px-1 py-2.5`}
>
{isEditLabelForm ? (
<CreateUpdateLabelInline

View File

@@ -97,7 +97,7 @@ export const ProjectSettingsLabelList: React.FC = observer(() => {
onClose={() => setSelectDeleteLabel(null)}
/>
<div className="flex items-center py-3.5 border-b border-custom-border-100 justify-between">
<div className="flex items-center justify-between border-b border-custom-border-100 py-3.5">
<h3 className="text-xl font-medium">Labels</h3>
<Button variant="primary" onClick={newLabel} size="sm">
Add label