diff --git a/webapp/src/components/navigation/SheetListMenu.tsx b/webapp/src/components/SheetTabBar/SheetListMenu.tsx similarity index 100% rename from webapp/src/components/navigation/SheetListMenu.tsx rename to webapp/src/components/SheetTabBar/SheetListMenu.tsx diff --git a/webapp/src/components/navigation/SheetRenameDialog.tsx b/webapp/src/components/SheetTabBar/SheetRenameDialog.tsx similarity index 95% rename from webapp/src/components/navigation/SheetRenameDialog.tsx rename to webapp/src/components/SheetTabBar/SheetRenameDialog.tsx index f8a4215..b6657d9 100644 --- a/webapp/src/components/navigation/SheetRenameDialog.tsx +++ b/webapp/src/components/SheetTabBar/SheetRenameDialog.tsx @@ -4,8 +4,8 @@ import { useTranslation } from "react-i18next"; import { theme } from "../../theme"; interface SheetRenameDialogProps { - isOpen: boolean; - close: () => void; + open: boolean; + onClose: () => void; onNameChanged: (name: string) => void; defaultName: string; } @@ -14,10 +14,10 @@ const SheetRenameDialog = (properties: SheetRenameDialogProps) => { const { t } = useTranslation(); const [name, setName] = useState(properties.defaultName); const handleClose = () => { - properties.close(); + properties.onClose(); }; return ( - + {t("sheet_rename.title")} {}}> @@ -53,7 +53,7 @@ const SheetRenameDialog = (properties: SheetRenameDialogProps) => { event.stopPropagation(); if (event.key === "Enter") { properties.onNameChanged(name); - properties.close(); + properties.onClose(); } }} onChange={(event) => { diff --git a/webapp/src/components/navigation/sheet.tsx b/webapp/src/components/SheetTabBar/SheetTab.tsx similarity index 95% rename from webapp/src/components/navigation/sheet.tsx rename to webapp/src/components/SheetTabBar/SheetTab.tsx index 31b3a82..51dcb95 100644 --- a/webapp/src/components/navigation/sheet.tsx +++ b/webapp/src/components/SheetTabBar/SheetTab.tsx @@ -6,7 +6,7 @@ import { isInReferenceMode } from "../editor/util"; import type { WorkbookState } from "../workbookState"; import SheetRenameDialog from "./SheetRenameDialog"; -interface SheetProps { +interface SheetTabProps { name: string; color: string; selected: boolean; @@ -17,7 +17,7 @@ interface SheetProps { workbookState: WorkbookState; } -function Sheet(props: SheetProps) { +function SheetTab(props: SheetTabProps) { const { name, color, selected, workbookState, onSelected } = props; const [anchorEl, setAnchorEl] = useState(null); const [colorPickerOpen, setColorPickerOpen] = useState(false); @@ -100,8 +100,8 @@ function Sheet(props: SheetProps) { { props.onRenamed(newName); @@ -159,4 +159,4 @@ const Name = styled("div")` text-wrap: nowrap; `; -export default Sheet; +export default SheetTab; diff --git a/webapp/src/components/navigation/navigation.tsx b/webapp/src/components/SheetTabBar/SheetTabBar.tsx similarity index 95% rename from webapp/src/components/navigation/navigation.tsx rename to webapp/src/components/SheetTabBar/SheetTabBar.tsx index 184ab7c..25fb057 100644 --- a/webapp/src/components/navigation/navigation.tsx +++ b/webapp/src/components/SheetTabBar/SheetTabBar.tsx @@ -7,10 +7,10 @@ import { NAVIGATION_HEIGHT } from "../constants"; import { StyledButton } from "../toolbar"; import type { WorkbookState } from "../workbookState"; import SheetListMenu from "./SheetListMenu"; -import Sheet from "./sheet"; +import SheetTab from "./SheetTab"; import type { SheetOptions } from "./types"; -export interface NavigationProps { +export interface SheetTabBarProps { sheets: SheetOptions[]; selectedIndex: number; workbookState: WorkbookState; @@ -21,7 +21,7 @@ export interface NavigationProps { onSheetDeleted: () => void; } -function Navigation(props: NavigationProps) { +function SheetTabBar(props: SheetTabBarProps) { const { t } = useTranslation(); const { workbookState, onSheetSelected, sheets, selectedIndex } = props; const [anchorEl, setAnchorEl] = useState(null); @@ -52,7 +52,7 @@ function Navigation(props: NavigationProps) { {sheets.map((tab, index) => ( - { }} /> -