-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #829 from gympass/EXUX-930
feat: [EXUX-930] Fix ellipsis/truncate problem on android
- Loading branch information
Showing
7 changed files
with
595 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
370 changes: 370 additions & 0 deletions
370
packages/yoga/src/Result/native/Result/TextWithBadge/__snapshots__/index.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,370 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`TextWithBadge should match snapshot 1`] = ` | ||
<View | ||
containerWidth={0} | ||
style={ | ||
[ | ||
{ | ||
"alignItems": "center", | ||
"flexDirection": "row", | ||
"justifyContent": "flex-end", | ||
"position": "relative", | ||
"width": 0, | ||
}, | ||
] | ||
} | ||
> | ||
<Text | ||
bold={true} | ||
numberOfLines={1} | ||
onLayout={[Function]} | ||
style={ | ||
[ | ||
{ | ||
"color": "#231B22", | ||
"flexBasis": 0, | ||
"flexGrow": 1, | ||
"flexShrink": 1, | ||
"fontFamily": "Rubik", | ||
"fontSize": 16, | ||
"fontWeight": "500", | ||
"left": 0, | ||
"lineHeight": 24, | ||
"paddingRight": 20, | ||
"position": "absolute", | ||
"width": "", | ||
}, | ||
] | ||
} | ||
textWidth={null} | ||
> | ||
Text with badge | ||
</Text> | ||
<View | ||
alignItems="center" | ||
bg="neon" | ||
borderRadius="circle" | ||
h="small" | ||
justifyContent="center" | ||
ml="xxxsmall" | ||
style={ | ||
[ | ||
{ | ||
"alignItems": "center", | ||
"backgroundColor": "#DCFF79", | ||
"borderRadius": 9999, | ||
"height": 16, | ||
"justifyContent": "center", | ||
"marginLeft": 4, | ||
"width": 16, | ||
}, | ||
] | ||
} | ||
w="small" | ||
> | ||
<RNSVGSvgView | ||
aria-hidden={true} | ||
bbHeight={10.67} | ||
bbWidth={10.67} | ||
fill="#231B22" | ||
focusable={false} | ||
height={10.67} | ||
style={ | ||
[ | ||
{ | ||
"backgroundColor": "transparent", | ||
"borderWidth": 0, | ||
}, | ||
[ | ||
{ | ||
"height": 10.67, | ||
"width": 10.67, | ||
}, | ||
], | ||
{ | ||
"opacity": 1, | ||
}, | ||
{ | ||
"flex": 0, | ||
"height": 10, | ||
"width": 10, | ||
}, | ||
] | ||
} | ||
width={10.67} | ||
> | ||
<RNSVGGroup | ||
fill={ | ||
[ | ||
0, | ||
4280490786, | ||
] | ||
} | ||
fillOpacity={1} | ||
fillRule={1} | ||
font={{}} | ||
matrix={ | ||
[ | ||
1, | ||
0, | ||
0, | ||
1, | ||
0, | ||
0, | ||
] | ||
} | ||
opacity={1} | ||
originX={0} | ||
originY={0} | ||
propList={ | ||
[ | ||
"fill", | ||
] | ||
} | ||
rotation={0} | ||
scaleX={1} | ||
scaleY={1} | ||
skewX={0} | ||
skewY={0} | ||
stroke={null} | ||
strokeDasharray={null} | ||
strokeDashoffset={null} | ||
strokeLinecap={0} | ||
strokeLinejoin={0} | ||
strokeMiterlimit={4} | ||
strokeOpacity={1} | ||
strokeWidth={1} | ||
vectorEffect={0} | ||
x={0} | ||
y={0} | ||
/> | ||
</RNSVGSvgView> | ||
</View> | ||
</View> | ||
`; | ||
|
||
exports[`TextWithBadge should match snapshot with long title 1`] = ` | ||
<View | ||
containerWidth={0} | ||
style={ | ||
[ | ||
{ | ||
"alignItems": "center", | ||
"flexDirection": "row", | ||
"justifyContent": "flex-end", | ||
"position": "relative", | ||
"width": 0, | ||
}, | ||
] | ||
} | ||
> | ||
<Text | ||
bold={true} | ||
numberOfLines={1} | ||
onLayout={[Function]} | ||
style={ | ||
[ | ||
{ | ||
"color": "#231B22", | ||
"flexBasis": 0, | ||
"flexGrow": 1, | ||
"flexShrink": 1, | ||
"fontFamily": "Rubik", | ||
"fontSize": 16, | ||
"fontWeight": "500", | ||
"left": 0, | ||
"lineHeight": 24, | ||
"paddingRight": 20, | ||
"position": "absolute", | ||
"width": "", | ||
}, | ||
] | ||
} | ||
textWidth={null} | ||
> | ||
This is an example of a very long title that should be truncated | ||
</Text> | ||
<View | ||
alignItems="center" | ||
bg="neon" | ||
borderRadius="circle" | ||
h="small" | ||
justifyContent="center" | ||
ml="xxxsmall" | ||
style={ | ||
[ | ||
{ | ||
"alignItems": "center", | ||
"backgroundColor": "#DCFF79", | ||
"borderRadius": 9999, | ||
"height": 16, | ||
"justifyContent": "center", | ||
"marginLeft": 4, | ||
"width": 16, | ||
}, | ||
] | ||
} | ||
w="small" | ||
> | ||
<RNSVGSvgView | ||
aria-hidden={true} | ||
bbHeight={10.67} | ||
bbWidth={10.67} | ||
fill="#231B22" | ||
focusable={false} | ||
height={10.67} | ||
style={ | ||
[ | ||
{ | ||
"backgroundColor": "transparent", | ||
"borderWidth": 0, | ||
}, | ||
[ | ||
{ | ||
"height": 10.67, | ||
"width": 10.67, | ||
}, | ||
], | ||
{ | ||
"opacity": 1, | ||
}, | ||
{ | ||
"flex": 0, | ||
"height": 10, | ||
"width": 10, | ||
}, | ||
] | ||
} | ||
width={10.67} | ||
> | ||
<RNSVGGroup | ||
fill={ | ||
[ | ||
0, | ||
4280490786, | ||
] | ||
} | ||
fillOpacity={1} | ||
fillRule={1} | ||
font={{}} | ||
matrix={ | ||
[ | ||
1, | ||
0, | ||
0, | ||
1, | ||
0, | ||
0, | ||
] | ||
} | ||
opacity={1} | ||
originX={0} | ||
originY={0} | ||
propList={ | ||
[ | ||
"fill", | ||
] | ||
} | ||
rotation={0} | ||
scaleX={1} | ||
scaleY={1} | ||
skewX={0} | ||
skewY={0} | ||
stroke={null} | ||
strokeDasharray={null} | ||
strokeDashoffset={null} | ||
strokeLinecap={0} | ||
strokeLinejoin={0} | ||
strokeMiterlimit={4} | ||
strokeOpacity={1} | ||
strokeWidth={1} | ||
vectorEffect={0} | ||
x={0} | ||
y={0} | ||
/> | ||
</RNSVGSvgView> | ||
</View> | ||
</View> | ||
`; | ||
|
||
exports[`TextWithBadge should match snapshot without badgeIcon 1`] = ` | ||
<View | ||
containerWidth={0} | ||
style={ | ||
[ | ||
{ | ||
"alignItems": "center", | ||
"flexDirection": "row", | ||
"justifyContent": "flex-end", | ||
"position": "relative", | ||
"width": 0, | ||
}, | ||
] | ||
} | ||
> | ||
<Text | ||
bold={true} | ||
numberOfLines={1} | ||
onLayout={[Function]} | ||
style={ | ||
[ | ||
{ | ||
"color": "#231B22", | ||
"flexBasis": 0, | ||
"flexGrow": 1, | ||
"flexShrink": 1, | ||
"fontFamily": "Rubik", | ||
"fontSize": 16, | ||
"fontWeight": "500", | ||
"left": 0, | ||
"lineHeight": 24, | ||
"paddingRight": 20, | ||
"position": "absolute", | ||
"width": "", | ||
}, | ||
] | ||
} | ||
textWidth={null} | ||
> | ||
Title without Badge | ||
</Text> | ||
<View | ||
alignItems="center" | ||
bg="neon" | ||
borderRadius="circle" | ||
h="small" | ||
justifyContent="center" | ||
ml="xxxsmall" | ||
style={ | ||
[ | ||
{ | ||
"alignItems": "center", | ||
"backgroundColor": "#DCFF79", | ||
"borderRadius": 9999, | ||
"height": 16, | ||
"justifyContent": "center", | ||
"marginLeft": 4, | ||
"width": 16, | ||
}, | ||
] | ||
} | ||
w="small" | ||
> | ||
<View | ||
aria-hidden={true} | ||
fill="#231B22" | ||
height={10.67} | ||
style={ | ||
[ | ||
{ | ||
"height": 10.67, | ||
"width": 10.67, | ||
}, | ||
] | ||
} | ||
width={10.67} | ||
/> | ||
</View> | ||
</View> | ||
`; |
Oops, something went wrong.