@momo-kits/step 0.0.43-beta.29 → 0.0.43-beta.32

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.
@@ -0,0 +1 @@
1
+ export const IS_VALID_URL = /((\w+:\/\/\S+)|(\w+[\.:]\w+\S+))[^\s,\.]/
@@ -2,6 +2,7 @@ import { Colors, IconSource, Image, Text } from '@momo-kits/core';
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { Component } from 'react';
4
4
  import { View, StyleSheet, Dimensions, ScrollView } from 'react-native';
5
+ import { IS_VALID_URL } from './Step.constants';
5
6
 
6
7
  const CIRCLE_SIZE = 24;
7
8
  const SCREEN_WIDTH = Dimensions.get('window').width;
@@ -154,15 +155,15 @@ export default class HorizontalStep extends Component {
154
155
  circleBorderColor = '',
155
156
  isActiveState = false,
156
157
  circleUnchecked = false,
157
- iconActive = {},
158
- iconUnchecked = {},
158
+ iconActive = '',
159
+ iconUnchecked = '',
159
160
  icon = {},
160
161
  index = 0,
161
162
  }) => {
162
163
  let resultComponent = <></>;
163
164
  if (!isActiveState) {
164
165
  if (circleUnchecked) {
165
- if (Object.keys(iconUnchecked).length === 0) {
166
+ if (IS_VALID_URL.test(iconUnchecked)) {
166
167
  resultComponent = this._renderCircleImage({
167
168
  icon,
168
169
  circleColor,
@@ -185,7 +186,7 @@ export default class HorizontalStep extends Component {
185
186
  } else {
186
187
  // This is active case
187
188
  // If icon diff "" & regex http or https url so will render image component
188
- if (Object.keys(iconActive).length === 0) {
189
+ if (IS_VALID_URL.test(iconActive)) {
189
190
  resultComponent = this._renderCircleImage({
190
191
  icon,
191
192
  circleColor,
package/Step.js CHANGED
@@ -45,9 +45,9 @@ Step.defaultProps = {
45
45
  titles: [],
46
46
  currentStep: 0,
47
47
  isVertical: false,
48
- iconActive: 'index + 1',
48
+ iconActive: IconSource.ic_check_24,
49
49
  iconChecked: IconSource.ic_check_24,
50
- iconUnchecked: 'index + 1',
50
+ iconUnchecked: IconSource.ic_check_24,
51
51
  circleColorActive: '#d82d8b',
52
52
  circleColorChecked: '#ffadd2',
53
53
  circleColorUnchecked: Colors.black_06,
package/Step.vertical.js CHANGED
@@ -2,6 +2,7 @@ import { Colors, IconSource, Image, Text } from '@momo-kits/core';
2
2
  import PropTypes from 'prop-types';
3
3
  import React, { Component } from 'react';
4
4
  import { View, StyleSheet, ScrollView } from 'react-native';
5
+ import { IS_VALID_URL } from './Step.constants';
5
6
 
6
7
  const CIRCLE_SIZE = 24;
7
8
 
@@ -142,7 +143,7 @@ export default class VerticalStep extends Component {
142
143
  let resultComponent = <></>;
143
144
  if (!isActiveState) {
144
145
  if (circleUnchecked) {
145
- if (Object.keys(iconUnchecked).length === 0) {
146
+ if (IS_VALID_URL.test(iconUnchecked)) {
146
147
  resultComponent = this._renderCircleImage({
147
148
  icon,
148
149
  circleColor,
@@ -165,7 +166,7 @@ export default class VerticalStep extends Component {
165
166
  } else {
166
167
  // This is active case
167
168
  // If icon diff "" & regex http or https url so will render image component
168
- if (Object.keys(iconActive).length === 0) {
169
+ if (IS_VALID_URL.test(iconActive)) {
169
170
  resultComponent = this._renderCircleImage({
170
171
  icon,
171
172
  circleColor,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/step",
3
- "version": "0.0.43-beta.29",
3
+ "version": "0.0.43-beta.32",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "dependencies": {},