diff --git a/packages/frontend/src/components/Avatar/index.tsx b/packages/frontend/src/components/Avatar/index.tsx index 395424aa2d..21173fba88 100644 --- a/packages/frontend/src/components/Avatar/index.tsx +++ b/packages/frontend/src/components/Avatar/index.tsx @@ -5,7 +5,6 @@ import useDialog from '../../hooks/dialog/useDialog' import FullscreenAvatar from '../dialogs/FullscreenAvatar' import type { Type } from '../../backend-com' -import type { PropsWithChildren } from 'react' import { get_first_emoji } from '@deltachat/message_parser_wasm' import { runtime } from '@deltachat-desktop/runtime-interface' @@ -100,9 +99,9 @@ export function AvatarFromContact( } export function ClickForFullscreenAvatarWrapper( - props: PropsWithChildren<{ + props: React.ButtonHTMLAttributes & { filename?: string - }> + } ) { const { openDialog } = useDialog() @@ -116,6 +115,7 @@ export function ClickForFullscreenAvatarWrapper( imagePath: filename!, }) }} + {...props} > {children} diff --git a/packages/frontend/src/components/Button/index.tsx b/packages/frontend/src/components/Button/index.tsx index ca358758ab..575c92aae8 100644 --- a/packages/frontend/src/components/Button/index.tsx +++ b/packages/frontend/src/components/Button/index.tsx @@ -3,38 +3,27 @@ import classNames from 'classnames' import styles from './style.module.scss' -type Props = React.PropsWithChildren<{ - 'aria-label'?: string - className?: string - disabled?: boolean +export type ButtonProps = React.ButtonHTMLAttributes & { active?: boolean - id?: string - onClick: any - type?: 'primary' | 'secondary' | 'danger' -}> + styling?: 'primary' | 'secondary' | 'danger' +} export default function Button({ children, - disabled = false, active = false, - id, - onClick, - type, + styling, + className, ...props -}: Props) { +}: ButtonProps) { return ( diff --git a/packages/frontend/src/components/Dialog/FooterActionButton.tsx b/packages/frontend/src/components/Dialog/FooterActionButton.tsx index 2b5ee562e8..b5efd4cf1e 100644 --- a/packages/frontend/src/components/Dialog/FooterActionButton.tsx +++ b/packages/frontend/src/components/Dialog/FooterActionButton.tsx @@ -2,29 +2,16 @@ import React from 'react' import Button from '../Button' -import type { MouseEventHandler, PropsWithChildren } from 'react' +import type { ButtonProps } from '../Button' import styles from './styles.module.scss' -type Props = PropsWithChildren<{ - onClick: MouseEventHandler - disabled?: boolean - danger?: boolean -}> - export default function FooterActionButton({ children, - onClick, - disabled = false, - danger = false, -}: Props) { + ...props +}: ButtonProps) { return ( - ) diff --git a/packages/frontend/src/components/LoginForm.tsx b/packages/frontend/src/components/LoginForm.tsx index 81d6c48f20..4231c26301 100644 --- a/packages/frontend/src/components/LoginForm.tsx +++ b/packages/frontend/src/components/LoginForm.tsx @@ -443,7 +443,7 @@ export function ConfigureProgressDialog({ - + {tx('cancel')} diff --git a/packages/frontend/src/components/composer/EmojiAndStickerPicker.tsx b/packages/frontend/src/components/composer/EmojiAndStickerPicker.tsx index 304a730ec5..d0da411593 100644 --- a/packages/frontend/src/components/composer/EmojiAndStickerPicker.tsx +++ b/packages/frontend/src/components/composer/EmojiAndStickerPicker.tsx @@ -95,7 +95,7 @@ export const StickerPicker = ({ ))}
-
diff --git a/packages/frontend/src/components/dialogs/ConfirmationDialog.tsx b/packages/frontend/src/components/dialogs/ConfirmationDialog.tsx index 141cfc6fcf..efe1efb9a7 100644 --- a/packages/frontend/src/components/dialogs/ConfirmationDialog.tsx +++ b/packages/frontend/src/components/dialogs/ConfirmationDialog.tsx @@ -57,7 +57,7 @@ export default function ConfirmationDialog({ {cancelLabel || tx('cancel')} handleClick(true)} > {confirmLabel || tx('yes')} diff --git a/packages/frontend/src/components/dialogs/ViewProfile/index.tsx b/packages/frontend/src/components/dialogs/ViewProfile/index.tsx index 0ad5f7ce45..d30235e6bf 100644 --- a/packages/frontend/src/components/dialogs/ViewProfile/index.tsx +++ b/packages/frontend/src/components/dialogs/ViewProfile/index.tsx @@ -270,7 +270,7 @@ export function ViewProfileInner({ > {!isDeviceChat && (