Skip to content

Commit 7a89664

Browse files
committed
開発者オーバレイに駅ナンバリングを表示
1 parent cb9dbe9 commit 7a89664

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/DevOverlay.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ describe('DevOverlay', () => {
102102
id: 1,
103103
name: 'テスト駅',
104104
nameRoman: 'Test Station',
105+
stationNumbers: [{ stationNumber: 'JK-01' }],
105106
} as Station);
106107
});
107108

@@ -174,7 +175,7 @@ describe('DevOverlay', () => {
174175
expect(getByText('NEXT TARGET')).toBeTruthy();
175176
expect(getByTestId('dev-overlay-next-value')).toHaveTextContent('500m');
176177
expect(getByTestId('dev-overlay-next-meta')).toHaveTextContent(
177-
'テスト駅'
178+
'テスト駅 / JK-01'
178179
);
179180
});
180181

src/components/DevOverlay.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,12 @@ const DevOverlay: React.FC = () => {
291291
const versionLabel = `TrainLCD DO ${Application.nativeApplicationVersion}(${Application.nativeBuildVersion})`;
292292
const telemetryValue = isTelemetryEnabled ? 'ON' : 'OFF';
293293
const backgroundValue = isBackgroundLocationTracking ? 'ON' : 'OFF';
294-
const nextStationMeta = nextStation?.name ?? undefined;
294+
const nextStationNumber =
295+
nextStation?.stationNumbers?.find((item) => !!item?.stationNumber)
296+
?.stationNumber ?? undefined;
297+
const nextStationMeta = [nextStation?.name, nextStationNumber]
298+
.filter(Boolean)
299+
.join(' / ');
295300

296301
const dim = useWindowDimensions();
297302
const [panelHeight, setPanelHeight] = useState(0);

0 commit comments

Comments
 (0)