Skip to content

Commit

Permalink
Merge pull request #66 from white-label-loyalty/fix/text-strings-error
Browse files Browse the repository at this point in the history
fix: make sure view isnt being rendered inside text
  • Loading branch information
iamgraeme authored Jan 1, 2025
2 parents 11d469f + e573537 commit fb2d743
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/components/organisms/RewardTile/reward-tile-points.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,22 @@ export const RewardTilePoints = (): JSX.Element | null => {

// Calculate points
const calculatedPoints = price * Number(pointsMultiplier ?? 1);
const fullPointsText = `${pointsPrefix}${calculatedPoints} ${pointsSuffix}`;

return (
<View
accessible
accessibilityRole="text"
accessibilityLabel={`Reward points: ${fullPointsText}`}
accessibilityLabel={`Reward points: ${pointsPrefix}${calculatedPoints} ${pointsSuffix}`}
>
<Text
variant="caption"
style={styles.footer}
accessibilityElementsHidden={true}
importantForAccessibility="no-hide-descendants"
>
<Text variant="caption" style={styles.footer}>
{pointsPrefix}
<View style={styles.pointsContainer}>
<Text variant="caption">{calculatedPoints}</Text>
<Text style={styles.suffix}>{pointsSuffix}</Text>
</View>
</Text>
<View style={styles.pointsContainer}>
<Text variant="caption">{calculatedPoints}</Text>
<Text variant="caption" style={styles.suffix}>
{pointsSuffix}
</Text>
</View>
</View>
);
};

0 comments on commit fb2d743

Please sign in to comment.