Skip to content

Commit 245ac8a

Browse files
authored
Merge pull request #5548 from TrainLCD/dev
canary
2 parents b96ced2 + fdd1bf8 commit 245ac8a

File tree

10 files changed

+194
-164
lines changed

10 files changed

+194
-164
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,12 @@ android {
141141
dimension "environment"
142142
applicationId "me.tinykitten.trainlcd.dev"
143143
versionNameSuffix "-dev"
144-
versionCode 100000308
144+
versionCode 100000309
145145
versionName "10.2.1"
146146
}
147147
prod {
148148
dimension "environment"
149-
versionCode 100000308
149+
versionCode 100000309
150150
versionName "10.2.1"
151151
}
152152
}

app.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default ({ config }: ConfigContext) => ({
5252
},
5353
},
5454
ios: {
55-
buildNumber: '2521',
55+
buildNumber: '2522',
5656
bundleIdentifier:
5757
process.env.EAS_BUILD_PROFILE === 'production'
5858
? 'me.tinykitten.trainlcd'
@@ -69,7 +69,7 @@ export default ({ config }: ConfigContext) => ({
6969
? 'me.tinykitten.trainlcd'
7070
: 'me.tinykitten.trainlcd.dev',
7171
permissions: [],
72-
versionCode: 100000308,
72+
versionCode: 100000309,
7373
},
7474
owner: 'trainlcd',
7575
});
@@ -85,3 +85,4 @@ export default ({ config }: ConfigContext) => ({
8585

8686

8787

88+

ios/TrainLCD.xcodeproj/project.pbxproj

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,7 +2419,7 @@
24192419
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
24202420
CODE_SIGN_IDENTITY = "Apple Development";
24212421
CODE_SIGN_STYLE = Automatic;
2422-
CURRENT_PROJECT_VERSION = 2521;
2422+
CURRENT_PROJECT_VERSION = 2522;
24232423
DEAD_CODE_STRIPPING = YES;
24242424
DEVELOPMENT_TEAM = E6R2G33Z36;
24252425
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
@@ -2458,7 +2458,7 @@
24582458
CODE_SIGN_ENTITLEMENTS = ProdTrainLCD.entitlements;
24592459
CODE_SIGN_IDENTITY = "Apple Development";
24602460
CODE_SIGN_STYLE = Automatic;
2461-
CURRENT_PROJECT_VERSION = 2521;
2461+
CURRENT_PROJECT_VERSION = 2522;
24622462
DEVELOPMENT_TEAM = E6R2G33Z36;
24632463
INFOPLIST_FILE = TrainLCD/Schemes/Prod/Info.plist;
24642464
INFOPLIST_KEY_CFBundleDisplayName = TrainLCD;
@@ -2517,7 +2517,7 @@
25172517
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
25182518
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
25192519
COPY_PHASE_STRIP = NO;
2520-
CURRENT_PROJECT_VERSION = 2521;
2520+
CURRENT_PROJECT_VERSION = 2522;
25212521
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
25222522
ENABLE_STRICT_OBJC_MSGSEND = YES;
25232523
ENABLE_TESTABILITY = YES;
@@ -2623,7 +2623,7 @@
26232623
CODE_SIGN_ENTITLEMENTS = TrainLCD/trainlcd.entitlements;
26242624
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
26252625
COPY_PHASE_STRIP = YES;
2626-
CURRENT_PROJECT_VERSION = 2521;
2626+
CURRENT_PROJECT_VERSION = 2522;
26272627
CXX = "$(REACT_NATIVE_PATH)/scripts/xcode/ccache-clang++.sh";
26282628
ENABLE_NS_ASSERTIONS = NO;
26292629
ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -2702,7 +2702,7 @@
27022702
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
27032703
CODE_SIGN_IDENTITY = "Apple Development";
27042704
CODE_SIGN_STYLE = Automatic;
2705-
CURRENT_PROJECT_VERSION = 2521;
2705+
CURRENT_PROJECT_VERSION = 2522;
27062706
DEAD_CODE_STRIPPING = YES;
27072707
DEVELOPMENT_TEAM = E6R2G33Z36;
27082708
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
@@ -2741,7 +2741,7 @@
27412741
CODE_SIGN_ENTITLEMENTS = CanaryTrainLCD.entitlements;
27422742
CODE_SIGN_IDENTITY = "Apple Development";
27432743
CODE_SIGN_STYLE = Automatic;
2744-
CURRENT_PROJECT_VERSION = 2521;
2744+
CURRENT_PROJECT_VERSION = 2522;
27452745
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
27462746
DEVELOPMENT_TEAM = E6R2G33Z36;
27472747
INFOPLIST_FILE = TrainLCD/Schemes/Dev/Info.plist;
@@ -2952,7 +2952,7 @@
29522952
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/CanaryRideSessionActivity.entitlements;
29532953
CODE_SIGN_IDENTITY = "Apple Development";
29542954
CODE_SIGN_STYLE = Automatic;
2955-
CURRENT_PROJECT_VERSION = 2521;
2955+
CURRENT_PROJECT_VERSION = 2522;
29562956
DEBUG_INFORMATION_FORMAT = dwarf;
29572957
DEVELOPMENT_TEAM = E6R2G33Z36;
29582958
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -3003,7 +3003,7 @@
30033003
CODE_SIGN_IDENTITY = "Apple Development";
30043004
CODE_SIGN_STYLE = Automatic;
30053005
COPY_PHASE_STRIP = NO;
3006-
CURRENT_PROJECT_VERSION = 2521;
3006+
CURRENT_PROJECT_VERSION = 2522;
30073007
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
30083008
DEVELOPMENT_TEAM = E6R2G33Z36;
30093009
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -3054,7 +3054,7 @@
30543054
CODE_SIGN_ENTITLEMENTS = WatchWidget/ProdWatchWidget.entitlements;
30553055
CODE_SIGN_IDENTITY = "Apple Development";
30563056
CODE_SIGN_STYLE = Automatic;
3057-
CURRENT_PROJECT_VERSION = 2521;
3057+
CURRENT_PROJECT_VERSION = 2522;
30583058
DEBUG_INFORMATION_FORMAT = dwarf;
30593059
DEVELOPMENT_TEAM = E6R2G33Z36;
30603060
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -3112,7 +3112,7 @@
31123112
CODE_SIGN_IDENTITY = "Apple Development";
31133113
CODE_SIGN_STYLE = Automatic;
31143114
COPY_PHASE_STRIP = NO;
3115-
CURRENT_PROJECT_VERSION = 2521;
3115+
CURRENT_PROJECT_VERSION = 2522;
31163116
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
31173117
DEVELOPMENT_TEAM = E6R2G33Z36;
31183118
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -3163,7 +3163,7 @@
31633163
CODE_SIGN_ENTITLEMENTS = WatchWidget/CanaryWatchWidget.entitlements;
31643164
CODE_SIGN_IDENTITY = "Apple Development";
31653165
CODE_SIGN_STYLE = Automatic;
3166-
CURRENT_PROJECT_VERSION = 2521;
3166+
CURRENT_PROJECT_VERSION = 2522;
31673167
DEBUG_INFORMATION_FORMAT = dwarf;
31683168
DEVELOPMENT_TEAM = E6R2G33Z36;
31693169
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -3220,7 +3220,7 @@
32203220
CODE_SIGN_IDENTITY = "Apple Development";
32213221
CODE_SIGN_STYLE = Automatic;
32223222
COPY_PHASE_STRIP = NO;
3223-
CURRENT_PROJECT_VERSION = 2521;
3223+
CURRENT_PROJECT_VERSION = 2522;
32243224
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
32253225
DEVELOPMENT_TEAM = E6R2G33Z36;
32263226
ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -3268,7 +3268,7 @@
32683268
CODE_SIGN_ENTITLEMENTS = RideSessionActivity/ProdRideSessionActivity.entitlements;
32693269
CODE_SIGN_IDENTITY = "Apple Development";
32703270
CODE_SIGN_STYLE = Automatic;
3271-
CURRENT_PROJECT_VERSION = 2521;
3271+
CURRENT_PROJECT_VERSION = 2522;
32723272
DEBUG_INFORMATION_FORMAT = dwarf;
32733273
DEVELOPMENT_TEAM = E6R2G33Z36;
32743274
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -3319,7 +3319,7 @@
33193319
CODE_SIGN_IDENTITY = "Apple Development";
33203320
CODE_SIGN_STYLE = Automatic;
33213321
COPY_PHASE_STRIP = NO;
3322-
CURRENT_PROJECT_VERSION = 2521;
3322+
CURRENT_PROJECT_VERSION = 2522;
33233323
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
33243324
DEVELOPMENT_TEAM = E6R2G33Z36;
33253325
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -3538,7 +3538,7 @@
35383538
CODE_SIGN_ENTITLEMENTS = ProdAppClip/ProdAppClip.entitlements;
35393539
CODE_SIGN_IDENTITY = "Apple Development";
35403540
CODE_SIGN_STYLE = Automatic;
3541-
CURRENT_PROJECT_VERSION = 2521;
3541+
CURRENT_PROJECT_VERSION = 2522;
35423542
DEBUG_INFORMATION_FORMAT = dwarf;
35433543
DEVELOPMENT_TEAM = E6R2G33Z36;
35443544
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -3594,7 +3594,7 @@
35943594
CODE_SIGN_IDENTITY = "Apple Development";
35953595
CODE_SIGN_STYLE = Automatic;
35963596
COPY_PHASE_STRIP = NO;
3597-
CURRENT_PROJECT_VERSION = 2521;
3597+
CURRENT_PROJECT_VERSION = 2522;
35983598
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
35993599
DEVELOPMENT_TEAM = E6R2G33Z36;
36003600
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -3644,7 +3644,7 @@
36443644
CODE_SIGN_ENTITLEMENTS = CanaryAppClip/CanaryAppClip.entitlements;
36453645
CODE_SIGN_IDENTITY = "Apple Development";
36463646
CODE_SIGN_STYLE = Automatic;
3647-
CURRENT_PROJECT_VERSION = 2521;
3647+
CURRENT_PROJECT_VERSION = 2522;
36483648
DEBUG_INFORMATION_FORMAT = dwarf;
36493649
DEVELOPMENT_TEAM = E6R2G33Z36;
36503650
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -3702,7 +3702,7 @@
37023702
CODE_SIGN_IDENTITY = "Apple Development";
37033703
CODE_SIGN_STYLE = Automatic;
37043704
COPY_PHASE_STRIP = NO;
3705-
CURRENT_PROJECT_VERSION = 2521;
3705+
CURRENT_PROJECT_VERSION = 2522;
37063706
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
37073707
DEVELOPMENT_TEAM = E6R2G33Z36;
37083708
ENABLE_USER_SCRIPT_SANDBOXING = NO;

src/components/CommonCard.tsx

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useAtomValue } from 'jotai';
22
import type React from 'react';
3-
import { useMemo } from 'react';
3+
import { memo, useMemo } from 'react';
44
import { StyleSheet, TouchableOpacity, View } from 'react-native';
55
import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
66
import { Path, Svg } from 'react-native-svg';
@@ -122,47 +122,44 @@ type SubtitleProps = {
122122
loading?: boolean;
123123
};
124124

125-
const Subtitle = ({
126-
inboundText,
127-
outboundText,
128-
numberOfLines,
129-
loading,
130-
}: SubtitleProps) => {
131-
if (loading) {
125+
const Subtitle = memo(
126+
({ inboundText, outboundText, numberOfLines, loading }: SubtitleProps) => {
127+
if (loading) {
128+
return (
129+
<View style={styles.subtitleContainer}>
130+
<SkeletonPlaceholder borderRadius={1} speed={1500}>
131+
<SkeletonPlaceholder.Item opacity={0.9} width={60} height={12} />
132+
</SkeletonPlaceholder>
133+
</View>
134+
);
135+
}
136+
132137
return (
133138
<View style={styles.subtitleContainer}>
134-
<SkeletonPlaceholder borderRadius={1} speed={1500}>
135-
<SkeletonPlaceholder.Item opacity={0.9} width={60} height={12} />
136-
</SkeletonPlaceholder>
139+
{inboundText ? (
140+
<Typography style={styles.subtitle} numberOfLines={numberOfLines}>
141+
{inboundText}
142+
</Typography>
143+
) : null}
144+
{inboundText && outboundText ? (
145+
<Svg width={16} height={16} viewBox="0 0 24 24" style={styles.arrow}>
146+
<Path
147+
d="M5 12h14M5 12l3-3M5 12l3 3M19 12l-3-3M19 12l-3 3"
148+
fill="none"
149+
stroke="#fff"
150+
strokeWidth={2}
151+
strokeLinecap="round"
152+
strokeLinejoin="round"
153+
/>
154+
</Svg>
155+
) : null}
156+
{outboundText ? (
157+
<Typography style={styles.subtitle}>{outboundText}</Typography>
158+
) : null}
137159
</View>
138160
);
139161
}
140-
141-
return (
142-
<View style={styles.subtitleContainer}>
143-
{inboundText ? (
144-
<Typography style={styles.subtitle} numberOfLines={numberOfLines}>
145-
{inboundText}
146-
</Typography>
147-
) : null}
148-
{inboundText && outboundText ? (
149-
<Svg width={16} height={16} viewBox="0 0 24 24" style={styles.arrow}>
150-
<Path
151-
d="M5 12h14M5 12l3-3M5 12l3 3M19 12l-3-3M19 12l-3 3"
152-
fill="none"
153-
stroke="#fff"
154-
strokeWidth={2}
155-
strokeLinecap="round"
156-
strokeLinejoin="round"
157-
/>
158-
</Svg>
159-
) : null}
160-
{outboundText ? (
161-
<Typography style={styles.subtitle}>{outboundText}</Typography>
162-
) : null}
163-
</View>
164-
);
165-
};
162+
);
166163

167164
export const CommonCard: React.FC<Props> = ({
168165
line,
@@ -216,6 +213,11 @@ export const CommonCard: React.FC<Props> = ({
216213
targetStation?.stationNumbers?.[0]?.lineSymbolColor;
217214
const targetStationThreeLetterCode = targetStation?.threeLetterCode;
218215

216+
const titleParts = useMemo(
217+
() => titleOrLineName.split(/(\([^)]*\))/),
218+
[titleOrLineName]
219+
);
220+
219221
const additionalRootStyle = useMemo(
220222
() => ({
221223
backgroundColor: line.color ?? '#333',
@@ -291,10 +293,10 @@ export const CommonCard: React.FC<Props> = ({
291293
)}
292294
<View style={styles.texts}>
293295
<Typography style={styles.title} numberOfLines={1}>
294-
{titleOrLineName.split(/(\([^)]*\))/).map((part, index, parts) =>
296+
{titleParts.map((part, index) =>
295297
/^\(.*\)$/.test(part) ? (
296298
<Typography key={`${index}-${part}`} style={styles.titleParens}>
297-
{index > 0 && !/\s$/.test(parts[index - 1] ?? '')
299+
{index > 0 && !/\s$/.test(titleParts[index - 1] ?? '')
298300
? ` ${part}`
299301
: part}
300302
</Typography>

src/components/FooterTabBar.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Ionicons } from '@expo/vector-icons';
22
import { useNavigation } from '@react-navigation/native';
33
import { useAtomValue } from 'jotai';
4-
import React, { useCallback, useMemo, useRef } from 'react';
4+
import React, { useCallback, useRef } from 'react';
55
import {
66
type LayoutChangeEvent,
77
Platform,
@@ -24,6 +24,11 @@ export type ButtonLayout = {
2424
height: number;
2525
};
2626

27+
const ICON_COLOR = {
28+
active: '#0A84FF',
29+
inactive: '#6B7280', // gray-500 相当
30+
} as const;
31+
2732
const styles = StyleSheet.create({
2833
container: {
2934
position: 'absolute',
@@ -100,14 +105,6 @@ const FooterTabBar: React.FC<Props> = ({
100105
[onSettingsButtonLayout]
101106
);
102107

103-
const iconColor = useMemo(
104-
() => ({
105-
active: '#0A84FF',
106-
inactive: '#6B7280', // gray-500 相当
107-
}),
108-
[]
109-
);
110-
111108
if (!visible) return null;
112109

113110
const safePad = Math.max(insets.bottom, Platform.OS === 'android' ? 8 : 0);
@@ -137,7 +134,7 @@ const FooterTabBar: React.FC<Props> = ({
137134
name={active === 'search' ? 'git-commit' : 'git-commit-outline'}
138135
size={26}
139136
color={
140-
active === 'search' ? iconColor.active : iconColor.inactive
137+
active === 'search' ? ICON_COLOR.active : ICON_COLOR.inactive
141138
}
142139
/>
143140
</Pressable>
@@ -152,7 +149,9 @@ const FooterTabBar: React.FC<Props> = ({
152149
<Ionicons
153150
name={active === 'home' ? 'navigate' : 'navigate-outline'}
154151
size={28}
155-
color={active === 'home' ? iconColor.active : iconColor.inactive}
152+
color={
153+
active === 'home' ? ICON_COLOR.active : ICON_COLOR.inactive
154+
}
156155
/>
157156
</Pressable>
158157

@@ -169,7 +168,7 @@ const FooterTabBar: React.FC<Props> = ({
169168
name={active === 'settings' ? 'settings' : 'settings-outline'}
170169
size={26}
171170
color={
172-
active === 'settings' ? iconColor.active : iconColor.inactive
171+
active === 'settings' ? ICON_COLOR.active : ICON_COLOR.inactive
173172
}
174173
/>
175174
</Pressable>

0 commit comments

Comments
 (0)