diff --git a/apps/client/src/widgets/mobile_widgets/TabSwitcher.css b/apps/client/src/widgets/mobile_widgets/TabSwitcher.css index 0bf9c51fd5..f0a17fd04c 100644 --- a/apps/client/src/widgets/mobile_widgets/TabSwitcher.css +++ b/apps/client/src/widgets/mobile_widgets/TabSwitcher.css @@ -80,7 +80,8 @@ &.type-book, &.type-contentWidget, - &.type-search { + &.type-search, + &.type-empty { display: flex; align-items: center; justify-content: center; diff --git a/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx b/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx index 45d7ee5754..c716731821 100644 --- a/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx +++ b/apps/client/src/widgets/mobile_widgets/TabSwitcher.tsx @@ -6,6 +6,7 @@ import { useCallback, useEffect, useRef, useState } from "preact/hooks"; import appContext from "../../components/app_context"; import NoteContext from "../../components/note_context"; +import FNote from "../../entities/fnote"; import { getHue, parseColor } from "../../services/css_class_manager"; import froca from "../../services/froca"; import { t } from "../../services/i18n"; @@ -143,19 +144,33 @@ function Tab({ noteContext, containerRef, selectTab, activeNtxId }: { />
- {note?.type === "book" - ? - : note && } +
); } +function TabPreviewContent({ note }: { + note: FNote | null +}) { + if (!note) { + return ; + } + + if (note.type === "book") { + return ; + } + + return ( + + ); +} + function PreviewPlaceholder({ icon}: { icon: string; }) {