diff --git a/frontend/src/components/editor-page/sidebar/sidebar-button/sidebar-button.module.scss b/frontend/src/components/editor-page/sidebar/sidebar-button/sidebar-button.module.scss index 04b209df3..ed4b159bd 100644 --- a/frontend/src/components/editor-page/sidebar/sidebar-button/sidebar-button.module.scss +++ b/frontend/src/components/editor-page/sidebar/sidebar-button/sidebar-button.module.scss @@ -57,6 +57,10 @@ width: 0; } + .disabled { + text-decoration: line-through; + } + &.sidebar-button-primary { color: var(--bs-light); background: var(--bs-primary); diff --git a/frontend/src/components/editor-page/sidebar/sidebar-button/sidebar-button.tsx b/frontend/src/components/editor-page/sidebar/sidebar-button/sidebar-button.tsx index 05ac73da9..5837f7976 100644 --- a/frontend/src/components/editor-page/sidebar/sidebar-button/sidebar-button.tsx +++ b/frontend/src/components/editor-page/sidebar/sidebar-button/sidebar-button.tsx @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -9,7 +9,9 @@ import { ShowIf } from '../../../common/show-if/show-if' import type { SidebarEntryProps } from '../types' import styles from './sidebar-button.module.scss' import type { PropsWithChildren } from 'react' -import React from 'react' +import React, { useCallback } from 'react' +import { OverlayTrigger, Tooltip } from 'react-bootstrap' +import type { OverlayInjectedProps } from 'react-bootstrap/Overlay' /** * A button that should be rendered in the sidebar. @@ -32,18 +34,30 @@ export const SidebarButton: React.FC> = ({ disabled, ...props }) => { + const tooltip = useCallback( + (overlayInjectedProps: OverlayInjectedProps) => { + if (!disabled) { + return <> + } + return This feature is not yet supported. + }, + [disabled] + ) + return ( - + + + ) } diff --git a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/export-menu-sidebar-menu.tsx b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/export-menu-sidebar-menu.tsx index 21e09f5be..643742225 100644 --- a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/export-menu-sidebar-menu.tsx +++ b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/export-menu-sidebar-menu.tsx @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -52,13 +52,19 @@ export const ExportMenuSidebarMenu: React.FC = ({ - Gist - Gitlab Snippet + + Gist + + + Gitlab Snippet + - HTML - + + HTML + + diff --git a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/import-menu-sidebar-menu.tsx b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/import-menu-sidebar-menu.tsx index feea1947e..840958a07 100644 --- a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/import-menu-sidebar-menu.tsx +++ b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/import-menu-sidebar-menu.tsx @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -52,9 +52,13 @@ export const ImportMenuSidebarMenu: React.FC = ({ - Gist - Gitlab Snippet - + + Gist + + + Gitlab Snippet + +