@quintype/native-components 2.31.0-beta.2 → 2.31.0-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.31.0-beta.2",
3
+ "version": "2.31.0-beta.4",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,7 +1,6 @@
1
1
  import PropTypes from "prop-types";
2
2
  import React, { useContext } from "react";
3
3
  import { Switch, View } from "react-native";
4
- import Icon from "react-native-vector-icons/FontAwesome";
5
4
  import { COMP_GENERAL_CONSTANTS } from "../../constants/component-constants/general-constants/constants";
6
5
  import { AppTheme } from "../../utils";
7
6
  import { Text } from "../Text";
@@ -11,8 +10,6 @@ export const CustomSwitch = ({
11
10
  label = "",
12
11
  callback,
13
12
  isEnabled = true,
14
- iconSize = 20,
15
- iconName,
16
13
  isSwitchDisabled = false,
17
14
  }) => {
18
15
  const { theme } = useContext(AppTheme);
@@ -24,15 +21,7 @@ export const CustomSwitch = ({
24
21
 
25
22
  return (
26
23
  <View style={styles.container} testID={COMP_GENERAL_CONSTANTS.customSwitch}>
27
- <View style={styles.textContainer}>
28
- {!iconName ? null : (
29
- <View style={styles.iconStyle}>
30
- <Icon size={iconSize} color={COLORS.MONO4} name={iconName} />
31
- </View>
32
- )}
33
-
34
- <Text style={styles.labelStyle}>{label}</Text>
35
- </View>
24
+ <Text style={styles.labelStyle}>{label}</Text>
36
25
  <Switch
37
26
  trackColor={{ false: COLORS.MONO1, true: COLORS.BRAND_1 }}
38
27
  thumbColor={isEnabled ? COLORS.MONO5 : COLORS.MONO5}
@@ -8,9 +8,6 @@ export const customSwitchStyles = () => {
8
8
  ...importStyles.container,
9
9
  justifyContent: 'space-between',
10
10
  },
11
- textContainer: {
12
- flexDirection: 'row',
13
- },
14
11
  };
15
12
 
16
13
  return {
@@ -9,20 +9,10 @@ export const iconTextStyles = () => {
9
9
  container: {
10
10
  alignItems: "center",
11
11
  flexDirection: "row",
12
- paddingVertical: 12,
13
- },
14
- iconContainerStyle: {
15
- marginRight: 15,
16
- },
17
- iconStyle: {
18
- color: COLORS.MONO4,
19
- textalign: "center",
20
- width: 30,
21
12
  },
22
13
  labelStyle: {
23
14
  color: COLORS.BRAND_BLACK,
24
15
  fontSize: FONT_SIZE.h3,
25
- opacity: 0.7,
26
16
  },
27
17
  });
28
18
  };
@@ -23,16 +23,8 @@ export const getTimeForStoryCards = (
23
23
  reverseTimeAdverbPosition = false,
24
24
  ) => {
25
25
  if (date) {
26
- const currentDate = new Date();
27
26
  const dateToFormat = new Date(date);
28
27
  const locale = dateFNSlocale[localTime];
29
- const distanceInMinutes = differenceInMinutes(currentDate, dateToFormat);
30
- if (distanceInMinutes <= 1440) {
31
- const timeDistance = formatDistanceToNowStrict(dateToFormat, { locale });
32
- return reverseTimeAdverbPosition
33
- ? `${translate('ago')} ${timeDistance}`
34
- : `${timeDistance} ${translate('ago')}`;
35
- }
36
28
  return dateFormat(dateToFormat, format, { locale });
37
29
  }
38
30
  return '';