@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 69 lines 2.6 KB
Raw
1 import { msg } from "gt-react-native";
2 import type { ViewStyle } from "react-native";
3
4 import { m, type MessageResolver } from "../../i18n/messages";
5 import type { MobileThemeVariables } from "../../lib/mobileTheme";
6
7 export const THREAD_LIST_V2_MONO_FONT = "monospace";
8 export const THREAD_LIST_V2_ROW_CONTENT_CLASS_NAME = "px-3 py-2.5";
9 export const THREAD_LIST_V2_ROW_DIVIDERS = false;
10 export const THREAD_LIST_V2_SIDEBAR_ROW_STYLE = {
11 borderRadius: 20,
12 paddingHorizontal: 12,
13 paddingVertical: 10,
14 } satisfies ViewStyle;
15 export const THREAD_LIST_V2_SIDEBAR_ROW_CONTAINER_STYLE = {
16 borderRadius: 20,
17 overflow: "hidden",
18 marginHorizontal: 8,
19 marginVertical: 2,
20 } satisfies ViewStyle;
21
22 export const selectedThreadRowColors = {
23 foregroundClassName: "text-thread-selected-foreground",
24 mutedForegroundClassName: "text-thread-selected-foreground-muted",
25 iconTintClassName: "accent-thread-selected-foreground",
26 mutedIconTintClassName: "accent-thread-selected-foreground-muted",
27 };
28
29 export function getThreadListV2NewBranchMenuTitle(branch: string, resolve: MessageResolver = m) {
30 return resolve(msg("New thread on {branch}", { branch }));
31 }
32
33 export function getThreadListV2RowAppearance(
34 theme: MobileThemeVariables,
35 sidebarPane: boolean,
36 selected: boolean,
37 ) {
38 const selectedBackgroundColor = theme["--color-thread-selected"];
39 const backgroundColor = theme[sidebarPane ? "--color-drawer" : "--color-screen"];
40 const style: ViewStyle = {
41 backgroundColor: selected ? selectedBackgroundColor : backgroundColor,
42 borderRadius: THREAD_LIST_V2_SIDEBAR_ROW_STYLE.borderRadius,
43 };
44 const swipeContainerStyle = THREAD_LIST_V2_SIDEBAR_ROW_CONTAINER_STYLE;
45
46 return {
47 className: undefined,
48 interactionClassName: sidebarPane ? "bg-thread-hover" : "bg-row-hover",
49 interactionOpacity: selected ? 0 : 1,
50 foregroundClassName: sidebarPane ? "text-drawer-foreground" : "text-foreground",
51 mutedForegroundClassName: sidebarPane
52 ? "text-drawer-foreground-muted"
53 : "text-foreground-muted",
54 tertiaryForegroundClassName: sidebarPane
55 ? "text-drawer-foreground-muted"
56 : "text-foreground-tertiary",
57 mutedIconTintClassName: sidebarPane
58 ? "accent-drawer-foreground-muted"
59 : "accent-foreground-muted",
60 tertiaryIconTintClassName: sidebarPane
61 ? "accent-drawer-foreground-muted"
62 : "accent-foreground-tertiary",
63 style,
64 cardStyle: sidebarPane ? { ...style, ...THREAD_LIST_V2_SIDEBAR_ROW_STYLE } : style,
65 swipeContainerStyle,
66 swipeBackgroundColor: backgroundColor,
67 providerIconSurfaceColor: selected ? selectedBackgroundColor : backgroundColor,
68 };
69 }