mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-04 00:48:51 -04:00
Fix react 18 changes
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
833a5d35a4
commit
931302cbec
20 changed files with 47 additions and 22 deletions
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { PropsWithChildren } from 'react'
|
||||
import React, { Fragment, useCallback, useState } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import { SidebarButton } from '../sidebar-button/sidebar-button'
|
||||
|
@ -21,7 +22,7 @@ import { ShowIf } from '../../../common/show-if/show-if'
|
|||
* @param hide {@code true} if the entry shouldn't be visible
|
||||
* @param className Additional css class names for the sidebar entry
|
||||
*/
|
||||
export const DeleteNoteSidebarEntry: React.FC<SpecificSidebarEntryProps> = ({ hide, className }) => {
|
||||
export const DeleteNoteSidebarEntry: React.FC<PropsWithChildren<SpecificSidebarEntryProps>> = ({ hide, className }) => {
|
||||
useTranslation()
|
||||
const [showDialog, setShowDialog] = useState(false)
|
||||
const noteId = useApplicationState((state) => state.noteDetails.id)
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { PropsWithChildren } from 'react'
|
||||
import React, { useMemo } from 'react'
|
||||
import { ForkAwesomeIcon } from '../../../common/fork-awesome/fork-awesome-icon'
|
||||
import type { IconName } from '../../../common/fork-awesome/types'
|
||||
|
@ -19,14 +20,14 @@ export interface SidebarButton extends SidebarEntryProps {
|
|||
* A button that should be rendered in the sidebar.
|
||||
*
|
||||
* @param children The react elements in the button
|
||||
* @param icon The icon at the left side of the button
|
||||
* @param icon The icon on the left side of the button
|
||||
* @param className Additional css class names
|
||||
* @param buttonRef A reference to the button
|
||||
* @param hide Should be {@code true} if the button should be invisible
|
||||
* @param variant An alternative theme for the button
|
||||
* @param props Other button props
|
||||
*/
|
||||
export const SidebarButton: React.FC<SidebarButton> = ({
|
||||
export const SidebarButton: React.FC<PropsWithChildren<SidebarButton>> = ({
|
||||
children,
|
||||
icon,
|
||||
className,
|
||||
|
|
|
@ -4,11 +4,12 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import type { PropsWithChildren } from 'react'
|
||||
import React from 'react'
|
||||
import type { SidebarMenuProps } from '../types'
|
||||
import styles from './sidebar-menu.module.scss'
|
||||
|
||||
export const SidebarMenu: React.FC<SidebarMenuProps> = ({ children, expand }) => {
|
||||
export const SidebarMenu: React.FC<PropsWithChildren<SidebarMenuProps>> = ({ children, expand }) => {
|
||||
return (
|
||||
<div className={`${styles['sidebar-menu']} ${expand ? styles['show'] : ''}`}>
|
||||
<div className={`d-flex flex-column`}>{children}</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue