Skip to content

Commit

Permalink
Merge pull request #5585 from GeekyAnts/release/3.4.24
Browse files Browse the repository at this point in the history
Release/3.4.24
  • Loading branch information
surajahmed authored Dec 5, 2022
2 parents 62674f0 + 51a28d4 commit bc96a3f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"prettier --write"
]
},
"version": "3.4.23",
"version": "3.4.24",
"license": "MIT",
"private": false,
"main": "lib/commonjs/index",
Expand Down
4 changes: 2 additions & 2 deletions src/components/composites/Popper/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
17 changes: 15 additions & 2 deletions src/components/primitives/Text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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'),
Expand All @@ -60,6 +61,18 @@ const Text = ({ children, ...props }: ITextProps, ref: any) => {
fontFamily = resolvedFontFamily;
}

// Need to apply fontWeight & fontStyle on web
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)) {
return null;
Expand Down

1 comment on commit bc96a3f

@vercel
Copy link

@vercel vercel bot commented on bc96a3f Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.