From 4fece94c97c756776ddc84041730bea6dc741bbe Mon Sep 17 00:00:00 2001 From: Suraj Ahmed Date: Thu, 1 Dec 2022 18:06:51 +0530 Subject: [PATCH 1/5] fix: popover crash fixes --- src/components/composites/Popper/Popper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/composites/Popper/Popper.tsx b/src/components/composites/Popper/Popper.tsx index 3f6d31fc2..3c1c63a1c 100644 --- a/src/components/composites/Popper/Popper.tsx +++ b/src/components/composites/Popper/Popper.tsx @@ -193,8 +193,8 @@ const PopperArrow = React.forwardRef( ); const arrowStyles = React.useMemo( - () => [arrowProps.style, triangleStyle, additionalStyles, style], - [triangleStyle, additionalStyles, arrowProps.style, style] + () => [arrowProps?.style, triangleStyle, additionalStyles, style], + [triangleStyle, additionalStyles, arrowProps?.style, style] ); return ( From 6b4e0ab30cd1c8ea4a0eab13e256958e90b56220 Mon Sep 17 00:00:00 2001 From: Suraj Ahmed Date: Thu, 1 Dec 2022 18:09:17 +0530 Subject: [PATCH 2/5] v3.4.24-alpha.0 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 651246579..b50e5c1a2 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "prettier --write" ] }, - "version": "3.4.22", + "version": "3.4.24-alpha.0", "license": "MIT", "private": false, "main": "lib/commonjs/index", @@ -46,8 +46,6 @@ "source": "src/index", "typings": "lib/typescript/index.d.ts", "devDependencies": { - "@types/lodash.has": "^4.5.6", - "@types/use-subscription": "^1.0.0", "@commitlint/config-conventional": "^8.3.4", "@react-native-community/bob": "^0.16.2", "@react-native-community/eslint-config": "^2.0.0", @@ -57,6 +55,7 @@ "@types/jest": "^26.0.0", "@types/lodash.clonedeep": "^4.5.6", "@types/lodash.get": "^4.4.6", + "@types/lodash.has": "^4.5.6", "@types/lodash.isempty": "^4.4.6", "@types/lodash.isequal": "^4.5.5", "@types/lodash.isnil": "^4.0.6", @@ -68,6 +67,7 @@ "@types/react": "^16.9.19", "@types/react-native": "~0.63.2", "@types/tinycolor2": "^1.4.2", + "@types/use-subscription": "^1.0.0", "babel-plugin-transform-remove-console": "^6.9.4", "commitlint": "^8.3.5", "eslint": "^7.10.0", From 328d1b8b87e81da3e9e615b2fd57679d0492ffb5 Mon Sep 17 00:00:00 2001 From: Viraj-10 Date: Mon, 5 Dec 2022 16:07:15 +0530 Subject: [PATCH 3/5] fix: font weight for web --- src/components/primitives/Text/index.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/primitives/Text/index.tsx b/src/components/primitives/Text/index.tsx index be9423592..7ec903e60 100644 --- a/src/components/primitives/Text/index.tsx +++ b/src/components/primitives/Text/index.tsx @@ -5,7 +5,7 @@ import { useHover } from '@react-native-aria/interactions'; import { mergeRefs } from '../../../utils/mergeRefs'; import { makeStyledComponent } from '../../../utils/styled'; import { useResolvedFontFamily } from '../../../hooks/useResolvedFontFamily'; -import { Text as NativeText } from 'react-native'; +import { Platform, Text as NativeText } from 'react-native'; import { useHasResponsiveProps } from '../../../hooks/useHasResponsiveProps'; const StyledText = makeStyledComponent(NativeText); @@ -49,8 +49,9 @@ const Text = ({ children, ...props }: ITextProps, ref: any) => { let fontFamily = propFontFamily; const fontStyle = italic ? 'italic' : propFontStyle; const fontWeight = bold ? 'bold' : propFontWeight; + let resolvedFontFamily; - const resolvedFontFamily = useResolvedFontFamily({ + resolvedFontFamily = useResolvedFontFamily({ fontFamily, fontWeight: fontWeight ?? (hasTextAncestor ? undefined : 400), fontStyle: fontStyle ?? (hasTextAncestor ? undefined : 'normal'), @@ -59,6 +60,16 @@ const Text = ({ children, ...props }: ITextProps, ref: any) => { if (resolvedFontFamily) { fontFamily = resolvedFontFamily; } + if (Platform.OS === 'web') { + if (resolvedFontFamily) { + fontFamily = resolvedFontFamily; + } + resolvedFontFamily = { + fontFamily, + fontWeight: fontWeight ?? (hasTextAncestor ? undefined : 400), + fontStyle: fontStyle ?? (hasTextAncestor ? undefined : 'normal'), + }; + } //TODO: refactor for responsive prop if (useHasResponsiveProps(props)) { From 16eece677c9e978db311a538a24a1478bcf04dcc Mon Sep 17 00:00:00 2001 From: Viraj-10 Date: Mon, 5 Dec 2022 16:11:02 +0530 Subject: [PATCH 4/5] fix: font weight added comments --- src/components/primitives/Text/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/primitives/Text/index.tsx b/src/components/primitives/Text/index.tsx index 7ec903e60..76fd3b1af 100644 --- a/src/components/primitives/Text/index.tsx +++ b/src/components/primitives/Text/index.tsx @@ -60,6 +60,8 @@ const Text = ({ children, ...props }: ITextProps, ref: any) => { if (resolvedFontFamily) { fontFamily = resolvedFontFamily; } + + // Need to apply fontWeight & fontStyle on web if (Platform.OS === 'web') { if (resolvedFontFamily) { fontFamily = resolvedFontFamily; From 51a28d439ebdbaaeae5d102edf8252c1102179ef Mon Sep 17 00:00:00 2001 From: Suraj Ahmed Date: Mon, 5 Dec 2022 16:19:24 +0530 Subject: [PATCH 5/5] v3.4.24 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e0cb5db1a..939ce1ae3 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "prettier --write" ] }, - "version": "3.4.23", + "version": "3.4.24", "license": "MIT", "private": false, "main": "lib/commonjs/index",