@widergy/mobile-ui 0.39.4 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [0.40.0](https://github.com/widergy/mobile-ui/compare/v0.39.4...v0.40.0) (2023-10-31)
2
+
3
+
4
+ ### Features
5
+
6
+ * adds step change functionality ([#252](https://github.com/widergy/mobile-ui/issues/252)) ([da14033](https://github.com/widergy/mobile-ui/commit/da14033a75deeb70b8992760fcf5f8961d609554))
7
+
1
8
  ## [0.39.4](https://github.com/widergy/mobile-ui/compare/v0.39.3...v0.39.4) (2023-10-26)
2
9
 
3
10
 
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  import React, { Fragment, useEffect, useRef, useState } from 'react';
3
- import { Animated, View } from 'react-native';
3
+ import { Animated, TouchableOpacity, View } from 'react-native';
4
4
  import _ from 'lodash';
5
5
 
6
6
  import IconButton from '../IconButton';
@@ -23,9 +23,10 @@ const StepFeedback = ({
23
23
  iconSize,
24
24
  labelsCentered,
25
25
  onClose,
26
+ onStepPress,
26
27
  steps,
27
28
  titleBottom,
28
- variant = 'default',
29
+ variant = 'default'
29
30
  }) => {
30
31
  const [offset, setOffset] = useState(0);
31
32
 
@@ -101,13 +102,34 @@ const StepFeedback = ({
101
102
  isComplete: index < currentIndex,
102
103
  isFuture: index > currentIndex
103
104
  };
105
+ const Wrapper = ({ children }) =>
106
+ onStepPress ? (
107
+ <TouchableOpacity
108
+ onPress={() => {
109
+ if (!status.isActive && !status.isFuture) onStepPress(step.step);
110
+ }}
111
+ >
112
+ {children}
113
+ </TouchableOpacity>
114
+ ) : (
115
+ children
116
+ );
104
117
 
105
118
  return (
106
119
  <Fragment>
107
120
  <View style={styles.stepContainer}>
108
- <View style={styles.centerStepContainer}>
109
- <CircleNumber hideStepNumber={hideStepNumber} index={index} status={status} step={step} themedStyles={styles} variant={variant} />
110
- </View>
121
+ <Wrapper>
122
+ <View style={styles.centerStepContainer}>
123
+ <CircleNumber
124
+ hideStepNumber={hideStepNumber}
125
+ index={index}
126
+ status={status}
127
+ step={step}
128
+ themedStyles={styles}
129
+ variant={variant}
130
+ />
131
+ </View>
132
+ </Wrapper>
111
133
  </View>
112
134
  {index < steps.length - 1 && (
113
135
  <View style={[styles.stepSeparator, status.isComplete && styles.stepSeparatorComplete]} />
@@ -12,7 +12,8 @@ export default {
12
12
  hideStepNumber: bool,
13
13
  iconSize: number,
14
14
  onClose: func,
15
+ onStepPress: func,
15
16
  steps: arrayOf(stepPropType).isRequired,
16
17
  titleBottom: bool,
17
- variant: string,
18
+ variant: string
18
19
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@widergy/mobile-ui",
3
3
  "description": "Widergy Mobile Components",
4
4
  "author": "widergy",
5
- "version": "0.39.4",
5
+ "version": "0.40.0",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [