Skip to content

Commit

Permalink
feat(task-description): refactor uploading images preview popup
Browse files Browse the repository at this point in the history
  • Loading branch information
suzit-10 committed Aug 23, 2024
1 parent 263c290 commit facbf11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { useTypedSelector } from '@Store/hooks';

const PreviewImage = () => {
const { clickedImage } = useTypedSelector(state => state.droneOperatorTask);
const clickedImage = useTypedSelector(
state => state.droneOperatorTask.clickedImage,
);
return (
<img
src={clickedImage}
Expand Down
10 changes: 10 additions & 0 deletions src/frontend/src/constants/modalContents.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { ReactElement } from 'react';
import ExitCreateProjectModal from '@Components/CreateProject/ExitCreateProjectModal';
import ImageBoxPopOver from '@Components/DroneOperatorTask/DescriptionSection/PopoverBox/ImageBox';

export type ModalContentsType =
| 'sign-up-success'
| 'quit-create-project'
| 'raw-image-preview'
| null;
export type PromptDialogContentsType = 'delete-layer' | null;

Expand All @@ -26,6 +28,14 @@ export function getModalContent(content: ModalContentsType): ModalReturnType {
title: 'Unsaved Changes!',
content: <ExitCreateProjectModal />,
};

case 'raw-image-preview':
return {
className: '!naxatw-w-[60vw]',
title: 'Upload Raw Image',
content: <ImageBoxPopOver />,
};

default:
return {
title: '',
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/store/actions/droneOperatorTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export const {
showPopover,
unCheckAllImages,
checkAllImages,
setFiles,
} = droneOperatorTaskSlice.actions;

0 comments on commit facbf11

Please sign in to comment.