diff --git a/packages/pl-fe/src/components/autosuggest-input.tsx b/packages/pl-fe/src/components/autosuggest-input.tsx index 9b230be3c..d78542b8a 100644 --- a/packages/pl-fe/src/components/autosuggest-input.tsx +++ b/packages/pl-fe/src/components/autosuggest-input.tsx @@ -247,8 +247,6 @@ const AutosuggestInput: React.FC = ({ return [
- - = ({ data-testid='autosuggest-input' theme={props.theme} lang={props.lang} + aria-label={props.placeholder} />
, diff --git a/packages/pl-fe/src/components/blurhash.tsx b/packages/pl-fe/src/components/blurhash.tsx index 0f0c6782d..9ba2cc727 100644 --- a/packages/pl-fe/src/components/blurhash.tsx +++ b/packages/pl-fe/src/components/blurhash.tsx @@ -1,7 +1,7 @@ import { decode } from 'blurhash'; import React, { useRef, useEffect } from 'react'; -interface IBlurhash { +interface IBlurhash extends Pick, 'className' | 'aria-label' | 'aria-hidden'> { /** Hash to render */ hash: string | null | undefined; /** Width of the blurred region in pixels. Defaults to 32. */ @@ -13,8 +13,6 @@ interface IBlurhash { * and canvas left untouched. */ dummy?: boolean; - /** className of the canvas element. */ - className?: string; } /** diff --git a/packages/pl-fe/src/components/media-gallery.tsx b/packages/pl-fe/src/components/media-gallery.tsx index eb800e4bc..ce00867ca 100644 --- a/packages/pl-fe/src/components/media-gallery.tsx +++ b/packages/pl-fe/src/components/media-gallery.tsx @@ -283,6 +283,8 @@ const Item: React.FC = ({ {(visible || !attachment.blurhash) && thumbnail} diff --git a/packages/pl-fe/src/components/search-input.tsx b/packages/pl-fe/src/components/search-input.tsx index 2fa3df71d..5f425297b 100644 --- a/packages/pl-fe/src/components/search-input.tsx +++ b/packages/pl-fe/src/components/search-input.tsx @@ -1,7 +1,7 @@ import { useNavigate } from '@tanstack/react-router'; import clsx from 'clsx'; import React, { useState } from 'react'; -import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; +import { defineMessages, useIntl } from 'react-intl'; import AutosuggestAccountInput from 'pl-fe/components/autosuggest-account-input'; import SvgIcon from 'pl-fe/components/ui/svg-icon'; @@ -63,12 +63,11 @@ const SearchInput = React.memo(() => { return (
- -
{
diff --git a/packages/pl-fe/src/components/sidebar-navigation-link.tsx b/packages/pl-fe/src/components/sidebar-navigation-link.tsx index b2ebc2a5d..1ead6775e 100644 --- a/packages/pl-fe/src/components/sidebar-navigation-link.tsx +++ b/packages/pl-fe/src/components/sidebar-navigation-link.tsx @@ -27,7 +27,7 @@ const SidebarNavigationLink = React.memo(React.forwardRef((props: ISidebarNaviga const matchRoute = useMatchRoute(); const { demetricator } = useSettings(); - const LinkComponent = (to === undefined ? 'div' : Link) as typeof Link; + const LinkComponent = (to === undefined ? 'button' : Link) as typeof Link; const isActive = matchRoute({ to }) !== false; diff --git a/packages/pl-fe/src/components/status-action-button.tsx b/packages/pl-fe/src/components/status-action-button.tsx index 232c1e18d..54b8489aa 100644 --- a/packages/pl-fe/src/components/status-action-button.tsx +++ b/packages/pl-fe/src/components/status-action-button.tsx @@ -50,6 +50,7 @@ const StatusActionButton = React.forwardRef ); }; diff --git a/packages/pl-fe/src/components/ui/accordion.tsx b/packages/pl-fe/src/components/ui/accordion.tsx index 8e2bdc017..7e9f092b6 100644 --- a/packages/pl-fe/src/components/ui/accordion.tsx +++ b/packages/pl-fe/src/components/ui/accordion.tsx @@ -66,12 +66,13 @@ const Accordion: React.FC = ({ headline, children, menu, expanded = )} {action && actionIcon && ( )}
diff --git a/packages/pl-fe/src/components/ui/card.tsx b/packages/pl-fe/src/components/ui/card.tsx index 7768fc201..87cf799cb 100644 --- a/packages/pl-fe/src/components/ui/card.tsx +++ b/packages/pl-fe/src/components/ui/card.tsx @@ -68,9 +68,8 @@ const CardHeader: React.FC = ({ className, children, backHref, onBa const backAttributes = backHref ? { to: backHref } : { onClick: onBackClick }; return ( - - - {intl.formatMessage(messages.back)} + + ); }; diff --git a/packages/pl-fe/src/components/ui/toast.tsx b/packages/pl-fe/src/components/ui/toast.tsx index 8e074aa6b..630c440ae 100644 --- a/packages/pl-fe/src/components/ui/toast.tsx +++ b/packages/pl-fe/src/components/ui/toast.tsx @@ -2,7 +2,7 @@ import { Link, type LinkOptions } from '@tanstack/react-router'; import clsx from 'clsx'; import React from 'react'; import toast, { Toast as RHToast } from 'react-hot-toast'; -import { FormattedMessage } from 'react-intl'; +import { defineMessages, useIntl, FormattedMessage } from 'react-intl'; import { ToastText, ToastType } from 'pl-fe/toast'; @@ -11,6 +11,10 @@ import Icon from './icon'; import Stack from './stack'; import Text from './text'; +const messages = defineMessages({ + close: { id: 'lightbox.close', defaultMessage: 'Close' }, +}); + const renderText = (text: ToastText) => { if (typeof text === 'string') { return text; @@ -35,6 +39,8 @@ interface IToast { const Toast = (props: IToast) => { const { t, message, type, action, actionLinkOptions, actionLabel, summary } = props; + const intl = useIntl(); + const dismissToast = () => toast.dismiss(t.id); const renderIcon = () => { @@ -141,8 +147,8 @@ const Toast = (props: IToast) => { className='inline-flex rounded-md text-gray-600 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:text-gray-600 dark:hover:text-gray-500' onClick={dismissToast} data-testid='toast-dismiss' + title={intl.formatMessage(messages.close)} > - diff --git a/packages/pl-fe/src/features/compose/components/content-type-button.tsx b/packages/pl-fe/src/features/compose/components/content-type-button.tsx index 5d49483ee..83851a784 100644 --- a/packages/pl-fe/src/features/compose/components/content-type-button.tsx +++ b/packages/pl-fe/src/features/compose/components/content-type-button.tsx @@ -87,9 +87,9 @@ const ContentTypeButton: React.FC = ({ composeId, compact }) }))} > ); diff --git a/packages/pl-fe/src/features/compose/components/language-dropdown.tsx b/packages/pl-fe/src/features/compose/components/language-dropdown.tsx index 9f12df2a9..465310e43 100644 --- a/packages/pl-fe/src/features/compose/components/language-dropdown.tsx +++ b/packages/pl-fe/src/features/compose/components/language-dropdown.tsx @@ -165,6 +165,7 @@ const getLanguageDropdown = (composeId: string): React.FC => > @@ -249,9 +250,9 @@ const LanguageDropdownButton: React.FC = ({ composeId, className='⁂-language-dropdown' > ); diff --git a/packages/pl-fe/src/features/compose/components/privacy-dropdown.tsx b/packages/pl-fe/src/features/compose/components/privacy-dropdown.tsx index f9cf0aafe..c08655113 100644 --- a/packages/pl-fe/src/features/compose/components/privacy-dropdown.tsx +++ b/packages/pl-fe/src/features/compose/components/privacy-dropdown.tsx @@ -182,9 +182,9 @@ const PrivacyDropdown: React.FC = ({ return ( ); diff --git a/packages/pl-fe/src/modals/list-editor-modal/components/search.tsx b/packages/pl-fe/src/modals/list-editor-modal/components/search.tsx index 3ecc6afb1..6dc77268f 100644 --- a/packages/pl-fe/src/modals/list-editor-modal/components/search.tsx +++ b/packages/pl-fe/src/modals/list-editor-modal/components/search.tsx @@ -36,9 +36,7 @@ const Search: React.FC = ({ value, onSubmit }) => { return (
-