Skip to content

Commit a0dfe80

Browse files
committed
chore(discovery): fix text wrapping in admonitions
1 parent 2a51898 commit a0dfe80

File tree

3 files changed

+20
-28
lines changed

3 files changed

+20
-28
lines changed

apps/demo/src/components/BodyAdmonitionAtom.tsx

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,23 @@ export default function BodyAdmonitionAtom({
3939
const dividerWidth = 6;
4040
const contentColor = useColorRoles().surface.secondaryContent;
4141
const iconSize = 22;
42-
const iconPadX = useSpacing(2);
42+
const space2 = useSpacing(2);
4343
return (
4444
<View {...props}>
45-
<Stack
45+
<View
4646
style={{
4747
borderLeftWidth: dividerWidth,
48-
borderLeftColor: semanticColor
49-
}}
50-
marginX={BODY_HZ_SPACING}
51-
space={2}>
48+
borderLeftColor: semanticColor,
49+
marginHorizontal: useSpacing(BODY_HZ_SPACING)
50+
}}>
5251
<Stack
5352
horizontal
5453
space={BODY_HZ_SPACING}
5554
style={{
56-
paddingLeft: iconPadX,
55+
paddingLeft: space2,
5756
flexDirection: 'row',
58-
alignItems: 'center'
57+
alignItems: 'center',
58+
marginBottom: space2
5959
}}>
6060
<IconNucleon
6161
color={semanticColor}
@@ -69,24 +69,17 @@ export default function BodyAdmonitionAtom({
6969
{title}
7070
</TextRoleNucleon>
7171
</Stack>
72-
<View
72+
<BodyParagraphAtom
7373
style={{
74-
flexDirection: 'row',
75-
flex: 0,
76-
alignItems: 'center'
77-
}}>
78-
<BodyParagraphAtom
79-
style={{
80-
flexGrow: 1,
81-
flexShrink: 1,
82-
alignSelf: 'stretch',
83-
justifyContent: 'center'
84-
}}
85-
color={contentColor}>
86-
{children}
87-
</BodyParagraphAtom>
88-
</View>
89-
</Stack>
74+
flexGrow: 1,
75+
flexShrink: 1,
76+
alignSelf: 'stretch',
77+
justifyContent: 'center'
78+
}}
79+
color={contentColor}>
80+
{children}
81+
</BodyParagraphAtom>
82+
</View>
9083
</View>
9184
);
9285
}

apps/demo/src/components/nucleons/TextRoleNucleon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default function TextRoleNucleon({
1515
return (
1616
<NativeText
1717
{...props}
18-
textBreakStrategy="highQuality"
18+
textBreakStrategy="simple"
1919
style={[generatedStyle, style]}
2020
/>
2121
);

apps/demo/src/components/screens/HomeDrawerScreen/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ interface ResourceRouteNav extends ResourceRouteDefinition {
2626

2727
const Drawer = createDrawerNavigator<Record<ResourceRoute, {}>>();
2828

29-
// const initialRouteName: ResourceRoute = 'root-intro';
30-
const initialRouteName: ResourceRoute = 'playground-lists';
29+
const initialRouteName: ResourceRoute = 'root-intro';
3130

3231
interface GroupDefinition {
3332
groupLabel: string;

0 commit comments

Comments
 (0)