Skip to content

Commit

Permalink
Unified select project dialog into one file
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcouch-sil committed Oct 13, 2023
1 parent dcdaa89 commit 1169776
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/renderer/components/dialogs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import SELECT_PROJECT_DIALOG from '@renderer/components/dialogs/select-project.dialog.old';
import SELECT_PROJECT_DIALOG from '@renderer/components/dialogs/select-project.dialog';
import { DialogDefinition, DialogTabTypes } from './dialog.data';

/**
Expand Down
18 changes: 0 additions & 18 deletions src/renderer/components/dialogs/select-project.dialog.old.ts

This file was deleted.

22 changes: 19 additions & 3 deletions src/renderer/components/dialogs/select-project.dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ import { useMemo } from 'react';
import ProjectList from '@renderer/components/project-components/project-list.component';
import usePromise from '@renderer/hooks/papi-hooks/use-promise.hook';
import projectLookupService from '@shared/services/project-lookup.service';
import { DialogProps } from '@renderer/components/dialogs/dialog-base.data';
import DIALOG_BASE, { DialogProps } from '@renderer/components/dialogs/dialog-base.data';
import { DialogDefinition } from '@renderer/components/dialogs/dialog.data';

type SelectProjectTabProps = DialogProps<string>;
type SelectProjectDialogProps = DialogProps<string>;

export default function SelectProjectTab({ prompt, submitDialog }: SelectProjectTabProps) {
const SELECT_PROJECT_DIALOG_TYPE = 'platform.selectProject';

function SelectProjectDialog({ prompt, submitDialog }: SelectProjectDialogProps) {
const [projects, isLoadingProjects] = usePromise(
projectLookupService.getMetadataForAllProjects,
useMemo(() => [], []),
Expand All @@ -30,3 +33,16 @@ export default function SelectProjectTab({ prompt, submitDialog }: SelectProject
</div>
);
}

const SELECT_PROJECT_DIALOG: DialogDefinition<typeof SELECT_PROJECT_DIALOG_TYPE> = {
...DIALOG_BASE,
tabType: SELECT_PROJECT_DIALOG_TYPE,
defaultTitle: 'Select Project',
initialSize: {
width: 500,
height: 350,
},
Component: SelectProjectDialog,
};

export default SELECT_PROJECT_DIALOG;

0 comments on commit 1169776

Please sign in to comment.