|
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,14 +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 }]}>$ npm run dev</Text> |
61 | | - <Text style={[lineStyle, { color: theme.palette[2] }]}>✓ Ready in 430ms</Text> |
62 | | - <Text style={[lineStyle, { color: theme.foreground }]}> |
63 | | - Local: http://localhost:3000{" "} |
64 | | - <Text style={[lineStyle, { color: theme.cursorForeground }]}>▏</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> |
| 82 | + </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> |
| 87 | + </Text> |
| 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" })}> |
| 92 | + http://127.0.0.1:5173/ |
| 93 | + </Text> |
| 94 | + </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> |
| 99 | + </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> |
65 | 106 | </Text> |
66 | 107 | </View> |
67 | 108 | ); |
|
0 commit comments