@quintype/native-components 2.29.9 → 2.30.0--center-align-logo-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.29.9",
3
+ "version": "2.30.0--center-align-logo-beta.0",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  import React, { memo } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import { useProgress, usePlaybackState, State } from "react-native-track-player";
4
- import { TouchableOpacity, ActivityIndicator, View, ViewPropTypes, useWindowDimensions } from "react-native";
4
+ import { TouchableOpacity, ActivityIndicator, View, useWindowDimensions } from "react-native";
5
5
  import Icon from "react-native-vector-icons/AntDesign";
6
6
  import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
7
7
  import { playerStyles } from "./styles";
@@ -135,7 +135,6 @@ ControlButton.propTypes = {
135
135
  };
136
136
 
137
137
  PlayerBase.propTypes = {
138
- style: ViewPropTypes.style,
139
138
  onTogglePlayback: PropTypes.func.isRequired,
140
139
  testID: PropTypes.string,
141
140
  };
@@ -5,7 +5,6 @@ import {
5
5
  StyleSheet,
6
6
  TouchableOpacity,
7
7
  View,
8
- ViewPropTypes,
9
8
  } from 'react-native';
10
9
  import Icon from 'react-native-vector-icons/AntDesign';
11
10
  import { COMP_GENERAL_CONSTANTS } from '../../constants/component-constants/general-constants/constants';
@@ -70,9 +69,6 @@ export const BackNavigator = (props) => {
70
69
 
71
70
  BackNavigator.propTypes = {
72
71
  title: PropTypes.string,
73
- style: ViewPropTypes.style,
74
- container: ViewPropTypes.style,
75
- titleStyle: ViewPropTypes.style,
76
72
  testID: PropTypes.string,
77
73
  onPress: PropTypes.func.isRequired,
78
74
  };
@@ -3,8 +3,7 @@ import React, { useContext } from "react";
3
3
  import {
4
4
  StyleSheet,
5
5
  TouchableOpacity,
6
- View,
7
- ViewPropTypes,
6
+ View
8
7
  } from "react-native";
9
8
  import { COMP_GENERAL_CONSTANTS } from "../../constants/component-constants/general-constants/constants";
10
9
  import { AppTheme } from "../../utils";
@@ -37,7 +36,5 @@ export const Button = (props) => {
37
36
  Button.propTypes = {
38
37
  icon: PropTypes.element,
39
38
  text: PropTypes.string,
40
- onPress: PropTypes.func,
41
- style: ViewPropTypes.style,
42
- textStyle: ViewPropTypes.style,
39
+ onPress: PropTypes.func
43
40
  };
@@ -3,8 +3,7 @@ import React, { useContext } from "react";
3
3
  import {
4
4
  StyleSheet,
5
5
  TouchableOpacity,
6
- View,
7
- ViewPropTypes,
6
+ View
8
7
  } from "react-native";
9
8
 
10
9
  import { COMP_GENERAL_CONSTANTS } from "../../constants/component-constants";
@@ -13,12 +12,35 @@ import { headerStyles } from "./styles";
13
12
 
14
13
  export const Header = (props) => {
15
14
  const { theme } = useContext(AppTheme);
16
- const styles = headerStyles(theme, props.noBorder);
15
+ const { noBorder, centerAlignLogo } = props || {};
16
+ const styles = headerStyles(theme, noBorder, centerAlignLogo);
17
17
  const headerStyle = StyleSheet.flatten([styles.header, props.style]);
18
18
  const logoComponentStyle = StyleSheet.flatten([
19
19
  styles.logoComponentStyle,
20
20
  props.logoComponentStyle,
21
21
  ]);
22
+ if (centerAlignLogo) {
23
+ return (
24
+ <View style={styles.header}>
25
+ <View style={styles.leftContainer}>
26
+ {props.leftComponent && props.leftComponent}
27
+ </View>
28
+ {props.logoComponent && (
29
+ <TouchableOpacity
30
+ style={logoComponentStyle}
31
+ onPress={props.onPress}
32
+ testID={COMP_GENERAL_CONSTANTS.headerLogoTouch}
33
+ >
34
+ {props.logoComponent}
35
+ </TouchableOpacity>
36
+ )}
37
+ <View style={styles.rightContainer}>
38
+ {props.rightComponent && props.rightComponent}
39
+ </View>
40
+ </View>
41
+ )
42
+ }
43
+
22
44
  return (
23
45
  <View style={headerStyle}>
24
46
  <View>
@@ -46,7 +68,6 @@ Header.propTypes = {
46
68
  rightComponent: PropTypes.element,
47
69
  leftComponent: PropTypes.element,
48
70
  logoComponent: PropTypes.element,
49
- style: ViewPropTypes.style,
50
71
  logoComponentStyle: PropTypes.object,
51
72
  onPress: PropTypes.func,
52
73
  noBorder: PropTypes.bool,
@@ -1,19 +1,35 @@
1
1
  import { StyleSheet } from 'react-native';
2
2
 
3
- export const headerStyles = (appThemeContext, noBorder) => {
3
+ export const headerStyles = (appThemeContext, noBorder, centerAlignLogo) => {
4
4
  const { COLORS, DARK_MODE } = appThemeContext;
5
- return StyleSheet.create({
5
+ const headerContainerStyles = {
6
6
  header: {
7
7
  height: 48,
8
8
  backgroundColor: DARK_MODE ? COLORS.MONO6 : COLORS.BRAND_WHITE,
9
9
  flexDirection: 'row',
10
10
  alignItems: 'center',
11
- justifyContent: 'space-between',
11
+ justifyContent: centerAlignLogo ? 'center' : 'space-between',
12
12
  paddingHorizontal: 10,
13
13
  borderBottomColor: noBorder
14
14
  ? (DARK_MODE ? COLORS.BRAND_WHITE : COLORS.BRAND_BLACK)
15
15
  : (DARK_MODE ? COLORS.MONO6 : COLORS.BRAND5),
16
16
  borderBottomWidth: StyleSheet.hairlineWidth,
17
- },
18
- });
17
+ }
18
+ }
19
+
20
+ if (centerAlignLogo) {
21
+ return StyleSheet.create({
22
+ ...headerContainerStyles,
23
+ leftContainer: {
24
+ flex: 1, // Takes up all left space
25
+ alignItems: 'flex-start', // Aligns leftView to the left
26
+ },
27
+ rightContainer: {
28
+ flex: 1, // Takes up all right space
29
+ alignItems: 'flex-end', // Aligns rightView to the right
30
+ }
31
+ });
32
+ }
33
+
34
+ return StyleSheet.create(headerContainerStyles);
19
35
  };
@@ -4,7 +4,6 @@ import {
4
4
  StyleSheet,
5
5
  TouchableOpacity,
6
6
  View,
7
- ViewPropTypes,
8
7
  } from "react-native";
9
8
  import Icon from "react-native-vector-icons/FontAwesome";
10
9
  import { COMP_GENERAL_CONSTANTS } from "../../constants/component-constants/general-constants/constants";
@@ -80,8 +79,6 @@ IconText.propTypes = {
80
79
  iconSize: PropTypes.number,
81
80
  onPress: PropTypes.func,
82
81
  disabled: PropTypes.bool,
83
- iconStyle: ViewPropTypes.style,
84
- labelStyle: ViewPropTypes.style,
85
82
  };
86
83
 
87
84
  export { IconText };
@@ -3,8 +3,7 @@ import React, { useContext } from "react";
3
3
  import {
4
4
  StyleSheet,
5
5
  TouchableOpacity,
6
- View,
7
- ViewPropTypes,
6
+ View
8
7
  } from "react-native";
9
8
  import { AppTheme } from "../../utils";
10
9
  import { radioButtonStyles } from "./styles";
@@ -41,6 +40,4 @@ export const RadioButton = ({
41
40
  RadioButton.propTypes = {
42
41
  onPress: PropTypes.func.isRequired,
43
42
  isChecked: PropTypes.bool,
44
- circleStyle: ViewPropTypes.style,
45
- checkedCircleStyle: ViewPropTypes.style,
46
43
  };
@@ -5,7 +5,7 @@ import { Linking, View, TouchableOpacity } from 'react-native';
5
5
  import { AppTheme } from '../../utils';
6
6
  import { Text } from '../Text';
7
7
  import { styles } from './styles';
8
- import Icon from "react-native-vector-icons/FontAwesome5";
8
+ import Icon from "react-native-vector-icons/FontAwesome";
9
9
 
10
10
  export const References = ({
11
11
  card, referenceNameTestId, referenceDescTestID, referenceContainerTestID,
@@ -22,7 +22,7 @@ export const References = ({
22
22
  <View style={referenceStyles.container} testID={referenceContainerTestID}>
23
23
  <View>
24
24
  <View style={referenceStyles.topSubContainer}>
25
- <Icon name={'external-link-alt'} size={FONT_SIZE.h2} style={referenceStyles.iconStyle} testID="referenceStoryIcon" />
25
+ <Icon name={'external-link'} size={FONT_SIZE.h2} style={referenceStyles.iconStyle} testID="referenceStoryIcon" />
26
26
  <Text style={referenceStyles.referenceText}>{'REFERENCE'}</Text>
27
27
  </View>
28
28
  <Text style={referenceStyles.name} testID={referenceNameTestId}>
@@ -16,7 +16,6 @@ export const styles = (COLORS, FONT_SIZE, FONT_FAMILY) => StyleSheet.create({
16
16
  },
17
17
  name: {
18
18
  fontSize: FONT_SIZE.h1,
19
- fontWeight: 'bold',
20
19
  marginTop:15,
21
20
  textDecorationLine:'underline',
22
21
  lineHeight:24,
@@ -31,8 +30,8 @@ export const styles = (COLORS, FONT_SIZE, FONT_FAMILY) => StyleSheet.create({
31
30
  },
32
31
  referenceText: {
33
32
  marginLeft:5,
34
- fontWeight:'700',
35
- fontSize: FONT_SIZE.h3
33
+ fontSize: FONT_SIZE.h3,
34
+ color:COLORS.BRAND_1,
36
35
  },
37
36
  topSubContainer:{
38
37
  display: 'flex',
@@ -2,7 +2,7 @@ import React, {
2
2
  useEffect, useRef, useContext, useState,
3
3
  } from 'react';
4
4
  import {
5
- View, TextInput, StyleSheet, ViewPropTypes, TouchableOpacity,
5
+ View, TextInput, StyleSheet, TouchableOpacity,
6
6
  } from 'react-native';
7
7
  import { useNavigation } from '@react-navigation/native';
8
8
  import PropTypes from 'prop-types';
@@ -78,8 +78,6 @@ Search.propTypes = {
78
78
  addListener: PropTypes.func,
79
79
  }),
80
80
  icon: PropTypes.element,
81
- style: ViewPropTypes.style,
82
- inputStyle: ViewPropTypes.style,
83
81
  onEnter: PropTypes.func,
84
82
  testID: PropTypes.string,
85
83
  };