@quintype/native-components 2.20.22 → 2.20.24
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 +9 -0
- package/package.json +1 -1
- package/src/components/PrimaryStoryCardNew/styles.js +5 -5
- package/src/components/References/index.js +9 -2
- package/src/components/References/styles.js +30 -7
- package/src/components/SecondaryStoryCardNew/styles.js +5 -5
- package/src/utils/colorUtils.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [2.20.24](https://github.com/quintype/native-components/compare/v2.20.23...v2.20.24) (2024-03-13)
|
|
6
|
+
|
|
7
|
+
### [2.20.23](https://github.com/quintype/native-components/compare/v2.20.22...v2.20.23) (2024-03-11)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **text:** Fix text-clipping issue for Kannada font ([943c14f](https://github.com/quintype/native-components/commit/943c14f4eb02159cc41114e6cdddd7c9ba9d883a))
|
|
13
|
+
|
|
5
14
|
### [2.20.22](https://github.com/quintype/native-components/compare/v2.20.21...v2.20.22) (2024-02-26)
|
|
6
15
|
|
|
7
16
|
|
package/package.json
CHANGED
|
@@ -15,13 +15,13 @@ export const storyStyles = (COLORS = {}, FONT_SIZE = {}) => ({
|
|
|
15
15
|
timestamp: {
|
|
16
16
|
color: COLORS?.BRAND_BLACK,
|
|
17
17
|
fontSize: FONT_SIZE.h5,
|
|
18
|
-
lineHeight: FONT_SIZE.h5 * 1.
|
|
18
|
+
lineHeight: FONT_SIZE.h5 * 1.5,
|
|
19
19
|
opacity: 0.6,
|
|
20
20
|
marginTop: 4,
|
|
21
21
|
},
|
|
22
22
|
headline: {
|
|
23
23
|
fontSize: FONT_SIZE.title,
|
|
24
|
-
lineHeight: FONT_SIZE.title * 1.
|
|
24
|
+
lineHeight: FONT_SIZE.title * 1.6,
|
|
25
25
|
color: COLORS.BRAND_BLACK,
|
|
26
26
|
marginTop: 4,
|
|
27
27
|
},
|
|
@@ -56,8 +56,8 @@ export const storyStyles = (COLORS = {}, FONT_SIZE = {}) => ({
|
|
|
56
56
|
borderRadius: 50,
|
|
57
57
|
backgroundColor: COLORS.BRAND_3,
|
|
58
58
|
},
|
|
59
|
-
premiumIcon:{
|
|
59
|
+
premiumIcon: {
|
|
60
60
|
marginTop: FONT_SIZE.h3 * 0.92,
|
|
61
|
-
marginRight:5
|
|
62
|
-
}
|
|
61
|
+
marginRight: 5,
|
|
62
|
+
},
|
|
63
63
|
});
|
|
@@ -6,24 +6,31 @@ import { TouchableOpacity } from 'react-native-gesture-handler';
|
|
|
6
6
|
import { AppTheme } from '../../utils';
|
|
7
7
|
import { Text } from '../Text';
|
|
8
8
|
import { styles } from './styles';
|
|
9
|
+
import Icon from "react-native-vector-icons/FontAwesome5";
|
|
9
10
|
|
|
10
11
|
export const References = ({
|
|
11
12
|
card, referenceNameTestId, referenceDescTestID, referenceContainerTestID,
|
|
12
13
|
}) => {
|
|
13
14
|
const reference = get(card, ['story-elements', 0, 'metadata'], {});
|
|
14
15
|
const { theme } = useContext(AppTheme);
|
|
15
|
-
const { COLORS, FONT_SIZE } = theme;
|
|
16
|
-
const referenceStyles = styles(COLORS, FONT_SIZE);
|
|
16
|
+
const { COLORS, FONT_SIZE, FONT_FAMILY } = theme;
|
|
17
|
+
const referenceStyles = styles(COLORS, FONT_SIZE, FONT_FAMILY);
|
|
17
18
|
|
|
18
19
|
const onPressHandler = () => Linking.openURL(reference?.url);
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
22
|
<TouchableOpacity onPress={onPressHandler}>
|
|
22
23
|
<View style={referenceStyles.container} testID={referenceContainerTestID}>
|
|
24
|
+
<View>
|
|
25
|
+
<View style={referenceStyles.topSubContainer}>
|
|
26
|
+
<Icon name={'external-link-alt'} size={FONT_SIZE.h2} style={referenceStyles.iconStyle} testID="referenceStoryIcon" />
|
|
27
|
+
<Text style={referenceStyles.referenceText}>{'REFERENCE'}</Text>
|
|
28
|
+
</View>
|
|
23
29
|
<Text style={referenceStyles.name} testID={referenceNameTestId}>
|
|
24
30
|
{reference?.name}
|
|
25
31
|
</Text>
|
|
26
32
|
{reference.description && <Text style={referenceStyles.description} testID={referenceDescTestID}>{reference.description}</Text>}
|
|
33
|
+
</View>
|
|
27
34
|
</View>
|
|
28
35
|
</TouchableOpacity>
|
|
29
36
|
|
|
@@ -1,22 +1,45 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { hexToRgb } from '../../utils/colorUtils';
|
|
2
3
|
|
|
3
|
-
export const styles = (COLORS, FONT_SIZE) => StyleSheet.create({
|
|
4
|
+
export const styles = (COLORS, FONT_SIZE, FONT_FAMILY) => StyleSheet.create({
|
|
4
5
|
container: {
|
|
5
|
-
paddingHorizontal:
|
|
6
|
+
paddingHorizontal: 20,
|
|
6
7
|
marginHorizontal: 30,
|
|
7
8
|
marginVertical: 5,
|
|
8
|
-
backgroundColor: COLORS.
|
|
9
|
+
backgroundColor: hexToRgb(COLORS.BRAND_1,0.1),
|
|
9
10
|
borderRadius: 5,
|
|
10
11
|
paddingVertical: 15,
|
|
11
12
|
display: 'flex',
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
minHeight: 200,
|
|
14
|
+
borderColor: COLORS.BRAND_1,
|
|
15
|
+
borderWidth:0.2
|
|
14
16
|
},
|
|
15
17
|
name: {
|
|
16
|
-
fontSize: FONT_SIZE.
|
|
18
|
+
fontSize: FONT_SIZE.h1,
|
|
17
19
|
fontWeight: 'bold',
|
|
20
|
+
marginTop:15,
|
|
21
|
+
textDecorationLine:'underline',
|
|
22
|
+
lineHeight:24,
|
|
23
|
+
color:COLORS.BRAND_1,
|
|
24
|
+
fontFamily:FONT_FAMILY.primaryBold
|
|
18
25
|
},
|
|
19
26
|
description: {
|
|
20
|
-
fontSize: FONT_SIZE.
|
|
27
|
+
fontSize: FONT_SIZE.h2,
|
|
28
|
+
color:COLORS.BRAND_1,
|
|
29
|
+
marginTop:10,
|
|
30
|
+
fontFamily: FONT_FAMILY.secondary
|
|
21
31
|
},
|
|
32
|
+
referenceText: {
|
|
33
|
+
marginLeft:5,
|
|
34
|
+
fontWeight:'700',
|
|
35
|
+
fontSize: FONT_SIZE.h3
|
|
36
|
+
},
|
|
37
|
+
topSubContainer:{
|
|
38
|
+
display: 'flex',
|
|
39
|
+
flex:1,
|
|
40
|
+
flexDirection:'row'
|
|
41
|
+
},
|
|
42
|
+
iconStyle:{
|
|
43
|
+
color: COLORS.BRAND_1
|
|
44
|
+
}
|
|
22
45
|
});
|
|
@@ -16,7 +16,7 @@ export const storyStyles = ({ COLORS, FONT_SIZE }) => StyleSheet.create({
|
|
|
16
16
|
timestamp: {
|
|
17
17
|
color: COLORS.BRAND_BLACK,
|
|
18
18
|
fontSize: FONT_SIZE.h5,
|
|
19
|
-
lineHeight: FONT_SIZE.h5 * 1.
|
|
19
|
+
lineHeight: FONT_SIZE.h5 * 1.5,
|
|
20
20
|
opacity: 0.6,
|
|
21
21
|
marginTop: 4,
|
|
22
22
|
},
|
|
@@ -24,7 +24,7 @@ export const storyStyles = ({ COLORS, FONT_SIZE }) => StyleSheet.create({
|
|
|
24
24
|
color: COLORS.BRAND_BLACK,
|
|
25
25
|
flexWrap: 'wrap',
|
|
26
26
|
fontSize: FONT_SIZE.h3,
|
|
27
|
-
lineHeight: FONT_SIZE.h3 * 1.
|
|
27
|
+
lineHeight: FONT_SIZE.h3 * 1.6,
|
|
28
28
|
},
|
|
29
29
|
icon: {
|
|
30
30
|
marginLeft: 8,
|
|
@@ -57,8 +57,8 @@ export const storyStyles = ({ COLORS, FONT_SIZE }) => StyleSheet.create({
|
|
|
57
57
|
borderRadius: 50,
|
|
58
58
|
backgroundColor: COLORS.BRAND_3,
|
|
59
59
|
},
|
|
60
|
-
premiumIcon:{
|
|
60
|
+
premiumIcon: {
|
|
61
61
|
marginTop: FONT_SIZE.h3 * 0.45,
|
|
62
|
-
marginRight:3
|
|
63
|
-
}
|
|
62
|
+
marginRight: 3,
|
|
63
|
+
},
|
|
64
64
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const hexToRgb = (hex, alpha=1) => {
|
|
2
|
+
let rgbCode = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(m, r, g, b) => '#' + r + r + g + g + b + b)
|
|
3
|
+
.substring(1).match(/.{2}/g)
|
|
4
|
+
.map(x => parseInt(x, 16));
|
|
5
|
+
console.log('risi - color', `rgb(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`)
|
|
6
|
+
return `rgba(${rgbCode[0]}, ${rgbCode[1]}, ${rgbCode[2]}, ${alpha})`;
|
|
7
|
+
}
|
|
8
|
+
|