Merge remote-tracking branch 'origin/develop' into schema-improvements

This commit is contained in:
Alex Gleason 2023-06-13 20:58:49 -05:00
commit 405dcef4a5
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
6 changed files with 14 additions and 31 deletions

View file

@ -43,6 +43,7 @@ const ListItem: React.FC<IListItem> = ({ label, hint, children, onClick, onSelec
const isSelect = child.type === SelectDropdown || child.type === Select;
return React.cloneElement(child, {
// @ts-ignore
id: domId,
className: clsx({
'w-auto': isSelect,

View file

@ -29,9 +29,12 @@ const FormGroup: React.FC<IFormGroup> = (props) => {
if (React.isValidElement(inputChildren[0])) {
firstChild = React.cloneElement(
inputChildren[0],
// @ts-ignore
{ id: formFieldId },
);
}
// @ts-ignore
const isCheckboxFormGroup = firstChild?.type === Checkbox;
if (isCheckboxFormGroup) {

View file

@ -1,6 +1,7 @@
import { AxiosError } from 'axios';
import React, { useMemo, useState } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { z } from 'zod';
import { useCreateGroup, useGroupValidation, type CreateGroupParams } from 'soapbox/api/hooks';
import { Modal, Stack } from 'soapbox/components/ui';
@ -71,9 +72,9 @@ const CreateGroupModal: React.FC<ICreateGroupModal> = ({ onClose }) => {
},
onError(error) {
if (error instanceof AxiosError) {
const msg = error.response?.data.error;
if (typeof msg === 'string') {
toast.error(msg);
const msg = z.object({ error: z.string() }).safeParse(error.response?.data);
if (msg.success) {
toast.error(msg.data.error);
}
}
},

View file

@ -33,26 +33,4 @@ export const requestFullscreen = (el: Element): void => {
// @ts-ignore
el.mozRequestFullScreen();
}
};
type FullscreenListener = (this: Document, ev: Event) => void;
export const attachFullscreenListener = (listener: FullscreenListener): void => {
if ('onfullscreenchange' in document) {
document.addEventListener('fullscreenchange', listener);
} else if ('onwebkitfullscreenchange' in document) {
document.addEventListener('webkitfullscreenchange', listener);
} else if ('onmozfullscreenchange' in document) {
document.addEventListener('mozfullscreenchange', listener);
}
};
export const detachFullscreenListener = (listener: FullscreenListener): void => {
if ('onfullscreenchange' in document) {
document.removeEventListener('fullscreenchange', listener);
} else if ('onwebkitfullscreenchange' in document) {
document.removeEventListener('webkitfullscreenchange', listener);
} else if ('onmozfullscreenchange' in document) {
document.removeEventListener('mozfullscreenchange', listener);
}
};
};

View file

@ -181,7 +181,7 @@
"ts-node": "^10.9.1",
"tslib": "^2.3.1",
"twemoji": "https://github.com/twitter/twemoji#v14.0.2",
"typescript": "^4.4.4",
"typescript": "^5.1.3",
"util": "^0.12.4",
"uuid": "^9.0.0",
"webpack": "^5.72.1",

View file

@ -17150,10 +17150,10 @@ typescript@^4.0:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.3.tgz#bdc5407caa2b109efd4f82fe130656f977a29324"
integrity sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==
typescript@^4.4.4:
version "4.5.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3"
integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==
typescript@^5.1.3:
version "5.1.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826"
integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==
typeson-registry@^1.0.0-alpha.20:
version "1.0.0-alpha.39"