Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sfr fixes part 2 #52

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
9 changes: 9 additions & 0 deletions app/src/components/form/Stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {View, StyleSheet, TouchableOpacity} from 'react-native';
import {Text} from 'react-native';
import Question from './Question';
import {useTheme} from '@react-navigation/native';
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';

function Stepper(props) {
const {colors} = useTheme();
Expand All @@ -12,9 +13,17 @@ function Stepper(props) {
props.onValueChange(
props.value === '' ? 0 : Number.parseInt(props.value, 10) + 1,
);
ReactNativeHapticFeedback.trigger('impactMedium', {
enableVibrateFallback: true,
ignoreAndroidSystemSettings: false,
});
} else {
if (props.value > 0) {
props.onValueChange(props.value - 1);
ReactNativeHapticFeedback.trigger('impactMedium', {
alaninnovates marked this conversation as resolved.
Show resolved Hide resolved
enableVibrateFallback: true,
ignoreAndroidSystemSettings: false,
});
}
}
};
Expand Down