diff --git a/src/renderer/features/context-menu/context-menu-provider.tsx b/src/renderer/features/context-menu/context-menu-provider.tsx index 81b1d019..a294eb6b 100644 --- a/src/renderer/features/context-menu/context-menu-provider.tsx +++ b/src/renderer/features/context-menu/context-menu-provider.tsx @@ -846,12 +846,12 @@ export const ContextMenuProvider = ({ children }: ContextMenuProviderProps) => { rightIcon: ( { handleUpdateRating(e); setRating(e); }} size="xs" + value={rating} /> ), @@ -891,6 +891,7 @@ export const ContextMenuProvider = ({ children }: ContextMenuProviderProps) => { handleOpenItemDetails, handlePlay, handleUpdateRating, + rating, ]); const mergedRef = useMergedRef(ref, clickOutsideRef); diff --git a/src/renderer/features/sharing/components/share-item-context-modal.tsx b/src/renderer/features/sharing/components/share-item-context-modal.tsx index 532643a8..86ab82e0 100644 --- a/src/renderer/features/sharing/components/share-item-context-modal.tsx +++ b/src/renderer/features/sharing/components/share-item-context-modal.tsx @@ -1,5 +1,6 @@ import { useForm } from '@mantine/form'; import { closeModal, ContextModalProps } from '@mantine/modals'; +import dayjs from 'dayjs'; import { useTranslation } from 'react-i18next'; import { useShareItem } from '/@/renderer/features/sharing/mutations/share-item-mutation'; @@ -26,8 +27,7 @@ export const ShareItemContextModal = ({ const shareItemMutation = useShareItem({}); // Uses the same default as Navidrome: 1 year - const defaultDate = new Date(); - defaultDate.setFullYear(defaultDate.getFullYear() + 1); + const defaultDate = dayjs().add(1, 'year').format('YYYY-MM-DD HH:mm:ss'); const form = useForm({ initialValues: { @@ -37,7 +37,7 @@ export const ShareItemContextModal = ({ }, validate: { expires: (value) => - value > new Date() + dayjs(value).isAfter(dayjs()) ? null : t('form.shareItem.expireInvalid', { postProcess: 'sentenceCase', @@ -51,7 +51,7 @@ export const ShareItemContextModal = ({ body: { description: values.description, downloadable: values.allowDownloading, - expires: values.expires.getTime(), + expires: dayjs(values.expires).valueOf(), resourceIds: itemIds.join(), resourceType, }, @@ -105,7 +105,7 @@ export const ShareItemContextModal = ({ postProcess: 'titleCase', })} minDate={new Date()} - placeholder={defaultDate.toLocaleDateString()} + placeholder={defaultDate} popoverProps={{ withinPortal: true }} valueFormat="MM/DD/YYYY HH:mm" {...form.getInputProps('expires')} diff --git a/src/shared/components/toast/toast.tsx b/src/shared/components/toast/toast.tsx index 57029582..6aeb00fa 100644 --- a/src/shared/components/toast/toast.tsx +++ b/src/shared/components/toast/toast.tsx @@ -1,4 +1,4 @@ -import type { NotificationsProps as MantineNotificationProps } from '@mantine/notifications'; +import type { NotificationData } from '@mantine/notifications'; import { cleanNotifications, @@ -11,7 +11,7 @@ import clsx from 'clsx'; import styles from './toast.module.css'; -interface NotificationProps extends MantineNotificationProps { +interface NotificationProps extends Omit { message?: string; onClose?: () => void; type?: 'error' | 'info' | 'success' | 'warning'; @@ -26,7 +26,7 @@ const getTitle = (type: NotificationProps['type']) => { const showToast = ({ message, onClose, type, ...props }: NotificationProps) => { return notifications.show({ - autoClose: props.autoClose, + ...props, classNames: { body: styles.body, closeButton: styles.closeButton,