fix: incorrect types in ActionNavigate
(#7462)
This commit is contained in:
parent
57ea4e61d1
commit
d91c98b82e
@ -39,15 +39,15 @@ export const actionGoToCollaborator = register({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
PanelComponent: ({ updateData, data, appState }) => {
|
PanelComponent: ({ updateData, data, appState }) => {
|
||||||
const [socketId, collaborator, withName, isBeingFollowed] =
|
const { clientId, collaborator, withName, isBeingFollowed } =
|
||||||
data as GoToCollaboratorComponentProps;
|
data as GoToCollaboratorComponentProps;
|
||||||
|
|
||||||
const background = getClientColor(socketId);
|
const background = getClientColor(clientId);
|
||||||
|
|
||||||
return withName ? (
|
return withName ? (
|
||||||
<div
|
<div
|
||||||
className="dropdown-menu-item dropdown-menu-item-base UserList__collaborator"
|
className="dropdown-menu-item dropdown-menu-item-base UserList__collaborator"
|
||||||
onClick={() => updateData({ ...collaborator, socketId })}
|
onClick={() => updateData<Collaborator>(collaborator)}
|
||||||
>
|
>
|
||||||
<Avatar
|
<Avatar
|
||||||
color={background}
|
color={background}
|
||||||
@ -71,7 +71,7 @@ export const actionGoToCollaborator = register({
|
|||||||
<Avatar
|
<Avatar
|
||||||
color={background}
|
color={background}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
updateData({ ...collaborator, socketId });
|
updateData(collaborator);
|
||||||
}}
|
}}
|
||||||
name={collaborator.username || ""}
|
name={collaborator.username || ""}
|
||||||
src={collaborator.avatarUrl}
|
src={collaborator.avatarUrl}
|
||||||
|
@ -129,7 +129,7 @@ export type ActionName =
|
|||||||
export type PanelComponentProps = {
|
export type PanelComponentProps = {
|
||||||
elements: readonly ExcalidrawElement[];
|
elements: readonly ExcalidrawElement[];
|
||||||
appState: AppState;
|
appState: AppState;
|
||||||
updateData: (formData?: any) => void;
|
updateData: <T = any>(formData?: T) => void;
|
||||||
appProps: ExcalidrawProps;
|
appProps: ExcalidrawProps;
|
||||||
data?: Record<string, any>;
|
data?: Record<string, any>;
|
||||||
app: AppClassProperties;
|
app: AppClassProperties;
|
||||||
|
@ -13,12 +13,12 @@ import { searchIcon } from "./icons";
|
|||||||
import { t } from "../i18n";
|
import { t } from "../i18n";
|
||||||
import { isShallowEqual } from "../utils";
|
import { isShallowEqual } from "../utils";
|
||||||
|
|
||||||
export type GoToCollaboratorComponentProps = [
|
export type GoToCollaboratorComponentProps = {
|
||||||
ClientId,
|
clientId: ClientId;
|
||||||
Collaborator,
|
collaborator: Collaborator;
|
||||||
boolean,
|
withName: boolean;
|
||||||
boolean,
|
isBeingFollowed: boolean;
|
||||||
];
|
};
|
||||||
|
|
||||||
/** collaborator user id or socket id (fallback) */
|
/** collaborator user id or socket id (fallback) */
|
||||||
type ClientId = string & { _brand: "UserId" };
|
type ClientId = string & { _brand: "UserId" };
|
||||||
@ -60,12 +60,12 @@ const renderCollaborator = ({
|
|||||||
shouldWrapWithTooltip?: boolean;
|
shouldWrapWithTooltip?: boolean;
|
||||||
isBeingFollowed: boolean;
|
isBeingFollowed: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const data: GoToCollaboratorComponentProps = [
|
const data: GoToCollaboratorComponentProps = {
|
||||||
clientId,
|
clientId,
|
||||||
collaborator,
|
collaborator,
|
||||||
withName,
|
withName,
|
||||||
isBeingFollowed,
|
isBeingFollowed,
|
||||||
];
|
};
|
||||||
const avatarJSX = actionManager.renderAction("goToCollaborator", data);
|
const avatarJSX = actionManager.renderAction("goToCollaborator", data);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user