mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-13 16:07:26 +01:00
make cellId optional
This commit is contained in:
@@ -54,11 +54,11 @@ export const SET_HOVERED_CELL = "SET_HOVERED_CELL";
|
|||||||
export interface SetHoveredCellAction {
|
export interface SetHoveredCellAction {
|
||||||
type: "SET_HOVERED_CELL";
|
type: "SET_HOVERED_CELL";
|
||||||
payload: {
|
payload: {
|
||||||
cellId: CellId;
|
cellId?: CellId;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const setHoveredCell = (payload: { cellId: CellId }): SetHoveredCellAction => {
|
export const setHoveredCell = (payload: { cellId?: CellId }): SetHoveredCellAction => {
|
||||||
return {
|
return {
|
||||||
type: SET_HOVERED_CELL,
|
type: SET_HOVERED_CELL,
|
||||||
payload,
|
payload,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class HoverableCell extends React.Component<ComponentProps & DispatchProps> {
|
|||||||
|
|
||||||
const mapDispatchToProps = (dispatch: Dispatch, { id }: { id: string }): DispatchProps => ({
|
const mapDispatchToProps = (dispatch: Dispatch, { id }: { id: string }): DispatchProps => ({
|
||||||
hover: () => dispatch(actions.setHoveredCell({ cellId: id })),
|
hover: () => dispatch(actions.setHoveredCell({ cellId: id })),
|
||||||
unHover: () => dispatch(actions.setHoveredCell({ cellId: "" })),
|
unHover: () => dispatch(actions.setHoveredCell({ cellId: undefined })),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(undefined, mapDispatchToProps)(HoverableCell);
|
export default connect(undefined, mapDispatchToProps)(HoverableCell);
|
||||||
|
|||||||
Reference in New Issue
Block a user