From 247f7eff33955a0331cadaaf4f1826e902e78469 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 29 Nov 2023 11:15:12 +0100 Subject: [PATCH] Move TabHeader and TabPanel components to a common location --- src/sidebar/components/HelpPanel.tsx | 4 ++-- src/sidebar/components/ShareDialog/ShareDialog.tsx | 4 ++-- src/sidebar/components/ShareDialog/test/ShareDialog-test.js | 4 ++-- src/sidebar/components/{ShareDialog => tabs}/TabHeader.tsx | 0 src/sidebar/components/{ShareDialog => tabs}/TabPanel.tsx | 0 src/sidebar/components/test/HelpPanel-test.js | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) rename src/sidebar/components/{ShareDialog => tabs}/TabHeader.tsx (100%) rename src/sidebar/components/{ShareDialog => tabs}/TabPanel.tsx (100%) diff --git a/src/sidebar/components/HelpPanel.tsx b/src/sidebar/components/HelpPanel.tsx index b098dfe534b..ba9117a9b87 100644 --- a/src/sidebar/components/HelpPanel.tsx +++ b/src/sidebar/components/HelpPanel.tsx @@ -8,11 +8,11 @@ import { VersionData } from '../helpers/version-data'; import { withServices } from '../service-context'; import type { SessionService } from '../services/session'; import { useSidebarStore } from '../store'; -import TabHeader from './ShareDialog/TabHeader'; -import TabPanel from './ShareDialog/TabPanel'; import SidebarPanel from './SidebarPanel'; import Tutorial from './Tutorial'; import VersionInfo from './VersionInfo'; +import TabHeader from './tabs/TabHeader'; +import TabPanel from './tabs/TabPanel'; type HelpPanelTabProps = { /** What the tab's link should say. */ diff --git a/src/sidebar/components/ShareDialog/ShareDialog.tsx b/src/sidebar/components/ShareDialog/ShareDialog.tsx index aac343d95ab..dd2677f319e 100644 --- a/src/sidebar/components/ShareDialog/ShareDialog.tsx +++ b/src/sidebar/components/ShareDialog/ShareDialog.tsx @@ -4,11 +4,11 @@ import { useState } from 'preact/hooks'; import { useSidebarStore } from '../../store'; import SidebarPanel from '../SidebarPanel'; +import TabHeader from '../tabs/TabHeader'; +import TabPanel from '../tabs/TabPanel'; import ExportAnnotations from './ExportAnnotations'; import ImportAnnotations from './ImportAnnotations'; import ShareAnnotations from './ShareAnnotations'; -import TabHeader from './TabHeader'; -import TabPanel from './TabPanel'; export type ShareDialogProps = { /** If true, the share tab will be rendered. Defaults to false */ diff --git a/src/sidebar/components/ShareDialog/test/ShareDialog-test.js b/src/sidebar/components/ShareDialog/test/ShareDialog-test.js index d7ea9c3a9c0..6d06776c675 100644 --- a/src/sidebar/components/ShareDialog/test/ShareDialog-test.js +++ b/src/sidebar/components/ShareDialog/test/ShareDialog-test.js @@ -28,8 +28,8 @@ describe('ShareDialog', () => { $imports.$mock(mockImportedComponents()); // Don't mock these related components for now $imports.$restore({ - './TabHeader': true, - './TabPanel': true, + '../tabs/TabHeader': true, + '../tabs/TabPanel': true, }); $imports.$mock({ '../../store': { useSidebarStore: () => fakeStore }, diff --git a/src/sidebar/components/ShareDialog/TabHeader.tsx b/src/sidebar/components/tabs/TabHeader.tsx similarity index 100% rename from src/sidebar/components/ShareDialog/TabHeader.tsx rename to src/sidebar/components/tabs/TabHeader.tsx diff --git a/src/sidebar/components/ShareDialog/TabPanel.tsx b/src/sidebar/components/tabs/TabPanel.tsx similarity index 100% rename from src/sidebar/components/ShareDialog/TabPanel.tsx rename to src/sidebar/components/tabs/TabPanel.tsx diff --git a/src/sidebar/components/test/HelpPanel-test.js b/src/sidebar/components/test/HelpPanel-test.js index 01baf0a2175..d4f540725a5 100644 --- a/src/sidebar/components/test/HelpPanel-test.js +++ b/src/sidebar/components/test/HelpPanel-test.js @@ -48,8 +48,8 @@ describe('HelpPanel', () => { }); $imports.$restore({ // Rendering TabHeader and TabPanel is needed for a11y tests - './ShareDialog/TabHeader': true, - './ShareDialog/TabPanel': true, + './tabs/TabHeader': true, + './tabs/TabPanel': true, }); });