fix: remaining strings

This commit is contained in:
Rohinish 2024-03-19 23:05:14 +05:30 committed by psychedelicious
parent dc9a9c0160
commit 9d30a063e7
3 changed files with 31 additions and 24 deletions

View File

@ -3,8 +3,8 @@ import { useAppSelector } from 'app/store/storeHooks';
import { IAINoContentFallback } from 'common/components/IAIImageFallback';
import DataViewer from 'features/gallery/components/ImageMetadataViewer/DataViewer';
import { selectNodesSlice } from 'features/nodes/store/nodesSlice';
import { useTranslation } from 'react-i18next';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
const selector = createMemoizedSelector(selectNodesSlice, (nodes) => {
const lastSelectedNodeId = nodes.selectedNodes[nodes.selectedNodes.length - 1];

View File

@ -8,19 +8,19 @@ import { selectOptimalDimension } from 'features/parameters/store/generationSlic
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
const ParamScaleBeforeProcessing = () => {
const dispatch = useAppDispatch();
const { t } = useTranslation();
const boundingBoxScaleMethod = useAppSelector((s) => s.canvas.boundingBoxScaleMethod);
const optimalDimension = useAppSelector(selectOptimalDimension);
const OPTIONS: ComboboxOption[] = useMemo(() => [
{ label: t('modelManager.none'), value: 'none' },
{ label: t('common.auto'), value: 'auto' },
{ label: t('modelManager.manual'), value: 'manual' },
],
[t]
const OPTIONS: ComboboxOption[] = useMemo(
() => [
{ label: t('modelManager.none'), value: 'none' },
{ label: t('common.auto'), value: 'auto' },
{ label: t('modelManager.manual'), value: 'manual' },
],
[t]
);
const onChange = useCallback<ComboboxOnChange>(
@ -33,7 +33,10 @@ const ParamScaleBeforeProcessing = () => {
[dispatch, optimalDimension]
);
const value = useMemo(() => OPTIONS.find((o) => o.value === boundingBoxScaleMethod), [boundingBoxScaleMethod]);
const value = useMemo(
() => OPTIONS.find((o) => o.value === boundingBoxScaleMethod),
[boundingBoxScaleMethod, OPTIONS]
);
return (
<FormControl>

View File

@ -42,7 +42,6 @@ const zDirection = z.enum(['ASC', 'DESC']);
type Direction = z.infer<typeof zDirection>;
const isDirection = (v: unknown): v is Direction => zDirection.safeParse(v).success;
const WorkflowLibraryList = () => {
const { t } = useTranslation();
const workflowCategories = useStore($workflowCategories);
@ -51,25 +50,27 @@ const WorkflowLibraryList = () => {
const [query, setQuery] = useState('');
const projectId = useStore($projectId);
const ORDER_BY_OPTIONS: ComboboxOption[] = useMemo(() => [
{ value: 'opened_at', label: t('workflows.opened') },
{ value: 'created_at', label: t('workflows.created') },
{ value: 'updated_at', label: t('workflows.updated') },
{ value: 'name', label: t('workflows.name') },
],
[t]
const ORDER_BY_OPTIONS: ComboboxOption[] = useMemo(
() => [
{ value: 'opened_at', label: t('workflows.opened') },
{ value: 'created_at', label: t('workflows.created') },
{ value: 'updated_at', label: t('workflows.updated') },
{ value: 'name', label: t('workflows.name') },
],
[t]
);
const DIRECTION_OPTIONS: ComboboxOption[] = useMemo(() => [
{ value: 'ASC', label: t('workflows.ascending') },
{ value: 'DESC', label: t('workflows.descending') },
],
[t]
const DIRECTION_OPTIONS: ComboboxOption[] = useMemo(
() => [
{ value: 'ASC', label: t('workflows.ascending') },
{ value: 'DESC', label: t('workflows.descending') },
],
[t]
);
const orderByOptions = useMemo(() => {
return projectId ? ORDER_BY_OPTIONS.filter((option) => option.value !== 'opened_at') : ORDER_BY_OPTIONS;
}, [projectId]);
}, [projectId, ORDER_BY_OPTIONS]);
const [order_by, setOrderBy] = useState<WorkflowRecordOrderBy>(orderByOptions[0]?.value as WorkflowRecordOrderBy);
const [direction, setDirection] = useState<SQLiteDirection>('ASC');
@ -120,7 +121,10 @@ const WorkflowLibraryList = () => {
},
[direction]
);
const valueDirection = useMemo(() => DIRECTION_OPTIONS.find((o) => o.value === direction), [direction]);
const valueDirection = useMemo(
() => DIRECTION_OPTIONS.find((o) => o.value === direction),
[direction, DIRECTION_OPTIONS]
);
const resetFilterText = useCallback(() => {
setQuery('');