Skip to content

Commit 0dc77c5

Browse files
authored
意味もなくヘッダーのレイアウトが機種依存していた (#5384)
1 parent 28e2a47 commit 0dc77c5

File tree

6 files changed

+12
-20
lines changed

6 files changed

+12
-20
lines changed

src/components/HeaderE235.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { LinearGradient } from 'expo-linear-gradient';
22
import React, { useMemo } from 'react';
3-
import { Platform, StyleSheet, View } from 'react-native';
3+
import { StyleSheet, View } from 'react-native';
44
import { STATION_NAME_FONT_SIZE } from '../constants';
55
import { useLoopLine } from '../hooks';
66
import isTablet from '../utils/isTablet';
@@ -220,7 +220,7 @@ const HeaderE235: React.FC<HeaderE235Props> = (props) => {
220220
threeLetterCode={threeLetterCode}
221221
withDarkTheme
222222
allowScaling
223-
transformOrigin={Platform.OS === 'android' ? 'bottom' : undefined}
223+
transformOrigin="bottom"
224224
/>
225225
) : null}
226226
<Typography

src/components/HeaderJL.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { LinearGradient } from 'expo-linear-gradient';
22
import React, { useMemo } from 'react';
3-
import { Platform, StyleSheet, View } from 'react-native';
3+
import { StyleSheet, View } from 'react-native';
44
import Svg, { Path } from 'react-native-svg';
55
import { useLoopLine } from '~/hooks';
66
import { STATION_NAME_FONT_SIZE } from '../constants';
@@ -223,7 +223,7 @@ const HeaderJL: React.FC<CommonHeaderProps> = (props) => {
223223
threeLetterCode={threeLetterCode}
224224
withDarkTheme
225225
allowScaling
226-
transformOrigin={Platform.OS === 'android' ? 'bottom' : undefined}
226+
transformOrigin="bottom"
227227
/>
228228
) : null}
229229
<Typography

src/components/HeaderJRWest.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Image } from 'expo-image';
33
import { LinearGradient } from 'expo-linear-gradient';
44
import React, { useCallback, useMemo } from 'react';
5-
import { Platform, StyleSheet, View } from 'react-native';
5+
import { StyleSheet, View } from 'react-native';
66
import { LineType, TrainTypeKind } from '~/@types/graphql';
77
import { useGetLineMark } from '~/hooks';
88
import {
@@ -511,9 +511,7 @@ const HeaderJRWest: React.FC<CommonHeaderProps> = (props) => {
511511
threeLetterCode={threeLetterCode}
512512
withDarkTheme
513513
allowScaling
514-
transformOrigin={
515-
Platform.OS === 'android' ? 'bottom' : undefined
516-
}
514+
transformOrigin="bottom"
517515
/>
518516
</View>
519517
) : null}

src/components/HeaderSaikyo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ const HeaderSaikyo: React.FC<CommonHeaderProps> = (props) => {
225225
stationNumber={currentStationNumber.stationNumber || ''}
226226
threeLetterCode={threeLetterCode}
227227
allowScaling
228-
transformOrigin={Platform.OS === 'android' ? 'bottom' : undefined}
228+
transformOrigin="bottom"
229229
/>
230230
) : null}
231231
<View style={styles.stationNameWrapper}>

src/components/HeaderTY.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { LinearGradient } from 'expo-linear-gradient';
22
import React from 'react';
3-
import {
4-
Platform,
5-
StyleSheet,
6-
Text,
7-
useWindowDimensions,
8-
View,
9-
} from 'react-native';
3+
import { StyleSheet, Text, useWindowDimensions, View } from 'react-native';
104
import Animated from 'react-native-reanimated';
115
import { STATION_NAME_FONT_SIZE } from '../constants';
126
import { useHeaderAnimation } from '../hooks';
@@ -225,7 +219,7 @@ const HeaderTY: React.FC<CommonHeaderProps> = (props) => {
225219
stationNumber={currentStationNumber.stationNumber || ''}
226220
threeLetterCode={threeLetterCode}
227221
allowScaling
228-
transformOrigin={Platform.OS === 'android' ? 'bottom' : undefined}
222+
transformOrigin="bottom"
229223
withDarkTheme
230224
/>
231225
) : null}

src/components/NumberingIconSquare.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const NumberingIconSquare: React.FC<Props> = ({
131131
threeLetterCode,
132132
allowScaling,
133133
size,
134-
transformOrigin = Platform.OS === 'android' ? 'center' : 'bottom',
134+
transformOrigin = 'center',
135135
withOutline,
136136
}: Props) => {
137137
const [lineSymbol, ...stationNumberRest] = stationNumberRaw.split('-');
@@ -143,7 +143,7 @@ const NumberingIconSquare: React.FC<Props> = ({
143143
style={[
144144
styles.tlcRoot,
145145
{
146-
transformOrigin: transformOrigin,
146+
transformOrigin,
147147
},
148148
]}
149149
>
@@ -178,7 +178,7 @@ const NumberingIconSquare: React.FC<Props> = ({
178178
style={
179179
allowScaling && {
180180
transform: [{ scale: 0.8 }],
181-
transformOrigin: 'bottom',
181+
transformOrigin,
182182
paddingVertical: isTablet ? 8 : 4,
183183
paddingHorizontal: isTablet ? 8 : 4,
184184
}

0 commit comments

Comments
 (0)