diff --git a/src/components/CameraControls/CameraHomeButton.tsx b/src/components/CameraControls/CameraHomeButton.tsx index 40e626ad..a7f34ffe 100644 --- a/src/components/CameraControls/CameraHomeButton.tsx +++ b/src/components/CameraControls/CameraHomeButton.tsx @@ -15,7 +15,7 @@ export const CameraHomeButton: React.FC = ({ tooltipText={"Home view (H)"} tooltipPlacement="left" icon={getIconGlyphClasses(IconGlyphs.Reset)} - clickHandler={resetCamera} + onClick={resetCamera} /> ); }; diff --git a/src/components/CameraControls/index.tsx b/src/components/CameraControls/index.tsx index aa22365a..0e4ffb3a 100644 --- a/src/components/CameraControls/index.tsx +++ b/src/components/CameraControls/index.tsx @@ -159,13 +159,13 @@ const CameraControls = ({ tooltipText="Zoom in ( ↑ )" tooltipPlacement="left" icon={ZoomIn} - clickHandler={zoomIn} + onClick={zoomIn} />
@@ -176,7 +176,7 @@ const CameraControls = ({ tooltipPlacement="left" icon={getIconGlyphClasses(IconGlyphs.Rotate)} radioGroupPosition={"top"} - clickHandler={() => setMode(ROTATE)} + onClick={() => setMode(ROTATE)} active={mode === ROTATE} /> setMode(PAN)} + onClick={() => setMode(PAN)} active={mode === PAN} />
@@ -192,7 +192,7 @@ const CameraControls = ({ tooltipText={"Focus (F)"} tooltipPlacement="left" icon={getIconGlyphClasses(IconGlyphs.Focus)} - clickHandler={() => { + onClick={() => { saveFocusMode(!isFocused); }} active={isFocused} @@ -203,7 +203,7 @@ const CameraControls = ({ tooltipPlacement="left" icon={getIconGlyphClasses(IconGlyphs.Orthographic)} radioGroupPosition={"top"} - clickHandler={() => { + onClick={() => { setCameraProjectionType(ORTHOGRAPHIC); }} active={cameraProjectionType === ORTHOGRAPHIC} @@ -213,7 +213,7 @@ const CameraControls = ({ tooltipPlacement="left" icon={getIconGlyphClasses(IconGlyphs.Perspective)} radioGroupPosition={"bottom"} - clickHandler={() => { + onClick={() => { setCameraProjectionType(PERSPECTIVE); }} active={cameraProjectionType === PERSPECTIVE} diff --git a/src/components/CustomDropdown/index.tsx b/src/components/CustomDropdown/index.tsx index 4dbe58e9..885d1635 100644 --- a/src/components/CustomDropdown/index.tsx +++ b/src/components/CustomDropdown/index.tsx @@ -131,7 +131,7 @@ const CustomDropdown: React.FC = ({ titleText={titleText} icon={icon} buttonType={buttonType} - clickHandler={buttonClickHandler} + onClick={buttonClickHandler} onKeyDown={handleKeyDown} onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeaveWithDelay} diff --git a/src/components/DownloadTrajectoryMenu/index.tsx b/src/components/DownloadTrajectoryMenu/index.tsx index dbe06769..c570da56 100644 --- a/src/components/DownloadTrajectoryMenu/index.tsx +++ b/src/components/DownloadTrajectoryMenu/index.tsx @@ -46,7 +46,7 @@ const DownloadTrajectoryMenu = ({ { label: ( { + onClick={() => { setModalVisible(!modalVisible); }} buttonType={ButtonClass.DropdownItem} diff --git a/src/components/LoadFileMenu/index.tsx b/src/components/LoadFileMenu/index.tsx index 4aa83f7b..830bc012 100644 --- a/src/components/LoadFileMenu/index.tsx +++ b/src/components/LoadFileMenu/index.tsx @@ -94,7 +94,7 @@ const LoadFileMenu = ({ label: ( ), diff --git a/src/components/NavButton/index.tsx b/src/components/NavButton/index.tsx index f989bbb2..05f8f3a1 100644 --- a/src/components/NavButton/index.tsx +++ b/src/components/NavButton/index.tsx @@ -8,7 +8,6 @@ export interface NavButtonProps extends ButtonProps { titleText?: string; buttonType?: string; icon?: ReactNode; - clickHandler?: () => void; isDisabled?: boolean; } @@ -19,7 +18,7 @@ const NavButton = forwardRef( titleText, buttonType = ButtonClass.Action, icon, - clickHandler, + onClick, isDisabled, ...props }, @@ -37,7 +36,7 @@ const NavButton = forwardRef( {...props} ref={ref} className={buttonClassNames} - onClick={!isDisabled ? clickHandler : undefined} + onClick={!isDisabled ? onClick : undefined} > {titleText} {icon} diff --git a/src/components/NavButtonWithTooltip/index.tsx b/src/components/NavButtonWithTooltip/index.tsx index 6511fa8d..7781ef66 100644 --- a/src/components/NavButtonWithTooltip/index.tsx +++ b/src/components/NavButtonWithTooltip/index.tsx @@ -24,7 +24,7 @@ const NavButtonWithTooltip: React.FC = ({ tooltipPlacement, buttonType, icon, - clickHandler, + onClick, isDisabled = false, ...props }) => { @@ -53,7 +53,7 @@ const NavButtonWithTooltip: React.FC = ({ icon, buttonType, isDisabled, - clickHandler, + onClick, onMouseEnter, onMouseLeave, }; @@ -69,7 +69,7 @@ const NavButtonWithTooltip: React.FC = ({ trigger={["hover", "focus"]} open={tooltipVisible} > - + ); }; diff --git a/src/components/PlaybackControls/index.tsx b/src/components/PlaybackControls/index.tsx index 939fd0ad..c6d4eb45 100644 --- a/src/components/PlaybackControls/index.tsx +++ b/src/components/PlaybackControls/index.tsx @@ -129,7 +129,7 @@ const PlayBackControls = ({ tooltipText={isPlaying ? "Pause" : "Play"} tooltipPlacement="top" icon={isPlaying ? Pause : Play} - clickHandler={isPlaying ? pauseHandler : playHandler} + onClick={isPlaying ? () => pauseHandler() : () => playHandler()} disabled={loading || isEmpty} loading={loading} /> @@ -169,7 +169,7 @@ const PlayBackControls = ({ tooltipText="Skip 1 frame back" tooltipPlacement="top" icon={getIconGlyphClasses(IconGlyphs.StepBack)} - clickHandler={prevHandler} + onClick={prevHandler} disabled={isStepBackDisabled || loading || isEmpty} loading={loading} /> @@ -178,7 +178,7 @@ const PlayBackControls = ({ tooltipText="Skip 1 frame ahead" tooltipPlacement="top" icon={getIconGlyphClasses(IconGlyphs.StepForward)} - clickHandler={nextHandler} + onClick={nextHandler} disabled={isStepForwardDisabled || loading || isEmpty} loading={loading} /> @@ -204,7 +204,7 @@ const PlayBackControls = ({ tooltipText={isLooping ? "Turn off looping" : "Turn on looping"} tooltipPlacement="top" icon={getIconGlyphClasses(IconGlyphs.Loop)} - clickHandler={loopHandler} + onClick={loopHandler} disabled={isEmpty} active={isLooping} loading={loading} diff --git a/src/components/RecordMoviesComponent/index.tsx b/src/components/RecordMoviesComponent/index.tsx index 056a5c8d..0eaa1ad3 100644 --- a/src/components/RecordMoviesComponent/index.tsx +++ b/src/components/RecordMoviesComponent/index.tsx @@ -114,7 +114,7 @@ const RecordMovieComponent = (props: RecordMovieComponentProps) => { tooltipWhenDisabled={true} tooltipText={getTooltipText()} icon={getIcon()} - clickHandler={isRecording ? stop : start} + onClick={isRecording ? stop : start} disabled={!supportedBrowser} onMouseEnter={() => setIsHovering(true)} onMouseLeave={() => setIsHovering(false)} diff --git a/src/components/ShareTrajectoryButton/index.tsx b/src/components/ShareTrajectoryButton/index.tsx index ab36b728..ec98bd03 100644 --- a/src/components/ShareTrajectoryButton/index.tsx +++ b/src/components/ShareTrajectoryButton/index.tsx @@ -34,7 +34,7 @@ const ShareTrajectoryButton = ({ tooltipPlacement="bottomLeft" titleText="Share" icon={Share} - clickHandler={handleShare} + onClick={handleShare} isDisabled={isDisabled} tooltipText={{ default: "Share trajectory", diff --git a/src/components/ViewportButton/index.tsx b/src/components/ViewportButton/index.tsx index 7d66cd52..a33cadcb 100644 --- a/src/components/ViewportButton/index.tsx +++ b/src/components/ViewportButton/index.tsx @@ -16,7 +16,6 @@ interface ViewportButtonProps extends ButtonProps { */ icon?: ReactNode | string; radioGroupPosition?: "top" | "bottom"; - clickHandler?: () => void; disabled?: boolean; active?: boolean; loading?: boolean; @@ -28,7 +27,7 @@ const ViewportButton: React.FC = ({ tooltipPlacement, tooltipWhenDisabled, icon, - clickHandler, + onClick, disabled, loading, active, @@ -61,7 +60,7 @@ const ViewportButton: React.FC = ({ const getTooltip = () => !disabled || tooltipWhenDisabled ? tooltipText : ""; - const getClickHandler = () => (!disabled ? clickHandler : undefined); + const onClickProp = !disabled ? onClick : undefined; const buttonClassNames = classNames([ className, @@ -79,7 +78,7 @@ const ViewportButton: React.FC = ({