|
1 | | -import { Platform, ScrollView, View, useColorScheme } from "react-native"; |
| 1 | +import { |
| 2 | + Platform, |
| 3 | + ScrollView, |
| 4 | + type StyleProp, |
| 5 | + type TextStyle, |
| 6 | + View, |
| 7 | + useColorScheme, |
| 8 | +} from "react-native"; |
2 | 9 |
|
3 | 10 | import { AppText as Text } from "../../../../components/AppText"; |
4 | 11 | import { |
@@ -54,39 +61,48 @@ export function TerminalAppearancePreview(props: { readonly fontSize: number }) |
54 | 61 | fontSize: props.fontSize, |
55 | 62 | lineHeight, |
56 | 63 | } as const; |
| 64 | + // AppText stamps the sans font on every node, so nested spans must |
| 65 | + // re-apply the terminal font instead of relying on inheritance, exactly |
| 66 | + // like the code preview's tokens below. |
| 67 | + const span = (color: string, extra?: TextStyle): StyleProp<TextStyle> => [ |
| 68 | + lineStyle, |
| 69 | + { color, ...extra }, |
| 70 | + ]; |
57 | 71 |
|
58 | 72 | return ( |
59 | 73 | <View className="p-4"> |
60 | | - <Text style={[lineStyle, { color: theme.foreground }]}> |
61 | | - <Text style={{ color: theme.palette[2] }}>→ </Text> |
62 | | - <Text style={{ color: theme.palette[6] }}>t3code </Text> |
63 | | - <Text style={{ color: theme.palette[4] }}>git:(</Text> |
64 | | - <Text style={{ color: theme.palette[1] }}>main</Text> |
65 | | - <Text style={{ color: theme.palette[4] }}>)</Text> |
66 | | - <Text style={{ color: theme.palette[3] }}> ✗</Text> |
67 | | - <Text> vpr dev</Text> |
| 74 | + <Text style={span(theme.foreground)}> |
| 75 | + <Text style={span(theme.palette[2])}>→ </Text> |
| 76 | + <Text style={span(theme.palette[6])}>t3code </Text> |
| 77 | + <Text style={span(theme.palette[4])}>git:(</Text> |
| 78 | + <Text style={span(theme.palette[1])}>main</Text> |
| 79 | + <Text style={span(theme.palette[4])}>)</Text> |
| 80 | + <Text style={span(theme.palette[3])}> ✗</Text> |
| 81 | + <Text style={span(theme.foreground)}> vpr dev</Text> |
68 | 82 | </Text> |
69 | | - <Text style={[lineStyle, { color: theme.foreground }]}> |
70 | | - <Text style={{ color: theme.palette[2] }}>VITE v7.1.1</Text> |
71 | | - <Text style={{ color: theme.mutedForeground }}> ready in</Text> |
72 | | - <Text> 1.24s</Text> |
| 83 | + <Text style={span(theme.foreground)}> |
| 84 | + <Text style={span(theme.palette[2])}>VITE v7.1.1</Text> |
| 85 | + <Text style={span(theme.mutedForeground)}> ready in</Text> |
| 86 | + <Text style={span(theme.foreground)}> 1.24s</Text> |
73 | 87 | </Text> |
74 | | - <Text style={[lineStyle, { color: theme.foreground }]}> |
75 | | - <Text style={{ color: theme.palette[2] }}>→ </Text> |
76 | | - <Text style={{ color: theme.mutedForeground }}>Local: </Text> |
77 | | - <Text style={{ color: theme.palette[6], textDecorationLine: "underline" }}> |
| 88 | + <Text style={span(theme.foreground)}> |
| 89 | + <Text style={span(theme.palette[2])}>→ </Text> |
| 90 | + <Text style={span(theme.mutedForeground)}>Local: </Text> |
| 91 | + <Text style={span(theme.palette[6], { textDecorationLine: "underline" })}> |
78 | 92 | http://127.0.0.1:5173/ |
79 | 93 | </Text> |
80 | 94 | </Text> |
81 | | - <Text style={[lineStyle, { color: theme.foreground }]}> |
82 | | - <Text style={{ color: theme.palette[2] }}>✓ 85 passed</Text> |
83 | | - <Text style={{ color: theme.palette[3] }}> △ 2 warnings</Text> |
84 | | - <Text style={{ color: theme.palette[1] }}> ✗ 0 failed</Text> |
| 95 | + <Text style={span(theme.foreground)}> |
| 96 | + <Text style={span(theme.palette[2])}>✓ 85 passed</Text> |
| 97 | + <Text style={span(theme.palette[3])}> △ 2 warnings</Text> |
| 98 | + <Text style={span(theme.palette[1])}> ✗ 0 failed</Text> |
85 | 99 | </Text> |
86 | | - <Text style={[lineStyle, { color: theme.foreground }]}> |
87 | | - <Text style={{ backgroundColor: theme.palette[2], color: theme.background }}> READY </Text> |
88 | | - <Text style={{ color: theme.mutedForeground }}> watching for changes</Text>{" "} |
89 | | - <Text style={{ color: theme.cursorForeground }}>▏</Text> |
| 100 | + <Text style={span(theme.foreground)}> |
| 101 | + <Text style={span(theme.background, { backgroundColor: theme.palette[2] })}> |
| 102 | + {" READY "} |
| 103 | + </Text> |
| 104 | + <Text style={span(theme.mutedForeground)}> watching for changes</Text>{" "} |
| 105 | + <Text style={span(theme.cursorForeground)}>▏</Text> |
90 | 106 | </Text> |
91 | 107 | </View> |
92 | 108 | ); |
|
0 commit comments