chore(prettier): full repo linting and code reformatting once and for all (#3627)

This commit is contained in:
Alireza authored and GitHub committed 2023-09-01 16:19:39 -04:00
1 parent 01500a2d4c
commit 9045ddaedc
656 files changed
+21737 -20628

No files matched your search

@@ -5,8 +5,7 @@ import { Icon } from '@ohif/ui';
import { Types } from '@ohif/core';
import ItemListComponent from './ItemListComponent';
const NO_WRAP_ELLIPSIS_CLASS_NAMES =
'text-ellipsis whitespace-nowrap overflow-hidden';
const NO_WRAP_ELLIPSIS_CLASS_NAMES = 'text-ellipsis whitespace-nowrap overflow-hidden';
type DataSourceConfigurationModalComponentProps = {
configurationAPI: Types.BaseDataSourceConfigurationAPI;
@@ -21,9 +20,7 @@ function DataSourceConfigurationModalComponent({
}: DataSourceConfigurationModalComponentProps) {
const { t } = useTranslation('DataSourceConfiguration');
const [itemList, setItemList] = useState<
Array<Types.BaseDataSourceConfigurationAPIItem>
>();
const [itemList, setItemList] = useState<Array<Types.BaseDataSourceConfigurationAPIItem>>();
const [selectedItems, setSelectedItems] = useState(configuredItems);
@@ -104,9 +101,7 @@ function DataSourceConfigurationModalComponent({
itemIndex < selectedItems.length
? classNames(
'bg-black/[.4]',
itemIndex !== itemLabels.length - 1
? 'hover:bg-transparent active:bg-secondary-dark'
: ''
itemIndex !== itemLabels.length - 1 ? 'hover:bg-transparent active:bg-secondary-dark' : ''
)
: 'bg-transparent';
@@ -118,17 +113,15 @@ function DataSourceConfigurationModalComponent({
: 'border border-dashed border-secondary-light';
const getSelectedItemTextClasses = itemIndex =>
itemIndex <= selectedItems.length
? 'text-primary-light'
: 'text-primary-active';
itemIndex <= selectedItems.length ? 'text-primary-light' : 'text-primary-active';
const getErrorComponent = (): ReactElement => {
return (
<div className="flex flex-col gap-4 min-h-[1px] grow">
<div className="flex min-h-[1px] grow flex-col gap-4">
<div className="text-primary-light text-[20px]">
{t(`Error fetching ${itemLabels[selectedItems.length]} list`)}
</div>
<div className="bg-black text-[14px] grow p-4">{errorMessage}</div>
<div className="grow bg-black p-4 text-[14px]">{errorMessage}</div>
</div>
);
};
@@ -141,7 +134,7 @@ function DataSourceConfigurationModalComponent({
<div
key={itemLabel}
className={classNames(
'rounded-md p-3.5 flex flex-col gap-1 shrink min-w-[1px] basis-[200px]',
'flex min-w-[1px] shrink basis-[200px] flex-col gap-1 rounded-md p-3.5',
getSelectedItemCursorClasses(itemLabelIndex),
getSelectedItemBackgroundClasses(itemLabelIndex),
getSelectedItemBorderClasses(itemLabelIndex),
@@ -152,30 +145,21 @@ function DataSourceConfigurationModalComponent({
itemLabelIndex <= currentSelectedItemIndex
? () => {
setShowFullConfig(false);
setSelectedItems(theList =>
theList.slice(0, itemLabelIndex)
);
setSelectedItems(theList => theList.slice(0, itemLabelIndex));
}
: undefined
}
>
<div className="flex gap-2 items-center text-">
<div className="text- flex items-center gap-2">
{itemLabelIndex < selectedItems.length ? (
<Icon name="status-tracked" />
) : (
<Icon name="status-untracked" />
)}
<div className={classNames(NO_WRAP_ELLIPSIS_CLASS_NAMES)}>
{t(itemLabel)}
</div>
<div className={classNames(NO_WRAP_ELLIPSIS_CLASS_NAMES)}>{t(itemLabel)}</div>
</div>
{itemLabelIndex < selectedItems.length ? (
<div
className={classNames(
'text-white text-[14px]',
NO_WRAP_ELLIPSIS_CLASS_NAMES
)}
>
<div className={classNames('text-[14px] text-white', NO_WRAP_ELLIPSIS_CLASS_NAMES)}>
{selectedItems[itemLabelIndex].name}
</div>
) : (
@@ -189,9 +173,9 @@ function DataSourceConfigurationModalComponent({
};
return (
<div className="h-[calc(100vh-300px)] flex flex-col pt-0.5 gap-4 select-none">
<div className="flex h-[calc(100vh-300px)] select-none flex-col gap-4 pt-0.5">
{getSelectedItemsComponent()}
<div className="w-full h-0.5 shrink-0 bg-black"></div>
<div className="h-0.5 w-full shrink-0 bg-black"></div>
{errorMessage ? (
getErrorComponent()
) : (
@@ -200,10 +184,7 @@ function DataSourceConfigurationModalComponent({
itemList={itemList}
onItemClicked={item => {
setShowFullConfig(false);
setSelectedItems(theList => [
...theList.slice(0, currentSelectedItemIndex + 1),
item,
]);
setSelectedItems(theList => [...theList.slice(0, currentSelectedItemIndex + 1), item]);
}}
></ItemListComponent>
)}