Skip to content

Commit

Permalink
fix(apps/mobile): prevent animations from occurring when button is di…
Browse files Browse the repository at this point in the history
…sabled
  • Loading branch information
hassankhan committed Oct 13, 2024
1 parent aa5a0a2 commit 1e73e34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/mobile/src/components/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ export const IconButton = ({
const [toggled, setToggled] = useState(false);
const handleTogglePressed = useCallback(
(e: GestureResponderEvent) => {
if (props.disabled) {
return;
}

setToggled(!toggled);
if (onPress) {
onPress(e);
}
},
[onPress, toggled]
[onPress, props.disabled, toggled]
);

const themedIconProps = {
Expand Down

0 comments on commit 1e73e34

Please sign in to comment.