onContextMenu(e, tag)}
/>
);
},
diff --git a/src/frontend/containers/ContentView/LayoutSwitcher.tsx b/src/frontend/containers/ContentView/LayoutSwitcher.tsx
index d06841760..b4967c32b 100644
--- a/src/frontend/containers/ContentView/LayoutSwitcher.tsx
+++ b/src/frontend/containers/ContentView/LayoutSwitcher.tsx
@@ -14,10 +14,9 @@ import { ContentRect } from './utils';
interface LayoutProps {
contentRect: ContentRect;
- showContextMenu: (x: number, y: number, menu: [JSX.Element, JSX.Element]) => void;
}
-const Layout = ({ contentRect, showContextMenu }: LayoutProps) => {
+const Layout = ({ contentRect }: LayoutProps) => {
const { fileStore, uiStore } = useStore();
// Todo: Select by dragging a rectangle shape
@@ -121,7 +120,7 @@ const Layout = ({ contentRect, showContextMenu }: LayoutProps) => {
return () => window.clearTimeout(handle);
}, [isSlideMode]);
- useCommandHandler(handleFileSelect, showContextMenu);
+ useCommandHandler(handleFileSelect);
if (contentRect.width < 10) {
return null;
diff --git a/src/frontend/containers/ContentView/Placeholder.tsx b/src/frontend/containers/ContentView/Placeholder.tsx
index 103f06247..c5681e5e3 100644
--- a/src/frontend/containers/ContentView/Placeholder.tsx
+++ b/src/frontend/containers/ContentView/Placeholder.tsx
@@ -1,12 +1,16 @@
-import React from 'react';
+import React, { useEffect, useState } from 'react';
import { observer } from 'mobx-react-lite';
import LOGO_FC from 'resources/logo/svg/full-color/allusion-logomark-fc.svg';
+import { IS_PREVIEW_WINDOW } from 'common/window';
import { useStore } from '../../contexts/StoreContext';
const Placeholder = observer(() => {
const { fileStore, tagStore } = useStore();
+ if (IS_PREVIEW_WINDOW) {
+ return ;
+ }
if (fileStore.showsAllContent && tagStore.isEmpty) {
// No tags exist, and no images added: Assuming it's a new user -> Show a welcome screen
return ;
@@ -26,6 +30,47 @@ const Placeholder = observer(() => {
export default Placeholder;
import { IconSet, Button, ButtonGroup, SVG } from 'widgets';
+import { RendererMessenger } from 'src/Messaging';
+import useMountState from 'src/frontend/hooks/useMountState';
+
+const PreviewWindowPlaceholder = observer(() => {
+ const { fileStore } = useStore();
+ const [isLoading, setIsLoading] = useState(true);
+ const [, isMounted] = useMountState();
+ useEffect(() => {
+ setIsLoading(true);
+ setTimeout(() => {
+ if (isMounted.current) {
+ setIsLoading(false);
+ }
+ }, 1000);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [fileStore.fileListLastModified]);
+
+ if (isLoading) {
+ return (
+ }>
+ {IconSet.LOADING}
+
+ );
+ }
+
+ // There should always be images to preview.
+ // If the placeholder is shown, something went wrong (probably the DB of the preview window is out of sync with the main window)
+ return (
+ }>
+ Something went wrong while previewing the selected images
+
+
+
+