Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

乗換案内のカッコ削除 #957

Merged
merged 1 commit into from
Sep 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/LineBoardEast/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { isJapanese } from '../../translation';
import navigationState from '../../store/atoms/navigation';
import PassChevronTY from '../PassChevronTY';
import { heightScale, widthScale } from '../../utils/scale';
import { parenthesisRegexp } from '../../constants/regexp';

const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
const { isPad } = Platform as PlatformIOSStatic;
Expand Down Expand Up @@ -315,9 +316,9 @@ const StationNameCell: React.FC<StationNameCellProps> = ({
const lineMarks = omittedTransferLines.map((l) => getLineMark(l));
const getLocalizedLineName = useCallback((l: Line) => {
if (isJapanese) {
return l.name;
return l.name.replace(parenthesisRegexp, '');
}
return l.nameR;
return l.nameR.replace(parenthesisRegexp, '');
}, []);

const [chevronColor, setChevronColor] = useState<'RED' | 'BLUE'>('BLUE');
Expand Down
5 changes: 3 additions & 2 deletions src/components/LineBoardSaikyo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { isJapanese } from '../../translation';
import navigationState from '../../store/atoms/navigation';
import PassChevronTY from '../PassChevronTY';
import { heightScale, widthScale } from '../../utils/scale';
import { parenthesisRegexp } from '../../constants/regexp';

const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
const { isPad } = Platform as PlatformIOSStatic;
Expand Down Expand Up @@ -323,9 +324,9 @@ const StationNameCell: React.FC<StationNameCellProps> = ({
const lineMarks = omittedTransferLines.map((l) => getLineMark(l));
const getLocalizedLineName = useCallback((l: Line) => {
if (isJapanese) {
return l.name;
return l.name.replace(parenthesisRegexp, '');
}
return l.nameR;
return l.nameR.replace(parenthesisRegexp, '');
}, []);

const [chevronColor, setChevronColor] = useState<'RED' | 'WHITE'>('RED');
Expand Down
5 changes: 3 additions & 2 deletions src/components/LineBoardWest/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { isJapanese } from '../../translation';
import navigationState from '../../store/atoms/navigation';
import { heightScale } from '../../utils/scale';
import stationState from '../../store/atoms/station';
import { parenthesisRegexp } from '../../constants/regexp';

interface Props {
line: Line;
Expand Down Expand Up @@ -301,9 +302,9 @@ const StationNameCell: React.FC<StationNameCellProps> = ({

const getLocalizedLineName = useCallback((l: Line) => {
if (isJapanese) {
return l.name;
return l.name.replace(parenthesisRegexp, '');
}
return l.nameR;
return l.nameR.replace(parenthesisRegexp, '');
}, []);

const PadLineMarks: React.FC = () => {
Expand Down
5 changes: 4 additions & 1 deletion src/components/LineBoardYamanotePad/PadArch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { getLineMark } from '../../lineMark';
import TransferLineMark from '../TransferLineMark';
import TransferLineDot from '../TransferLineDot';
import { isJapanese, translate } from '../../translation';
import { parenthesisRegexp } from '../../constants/regexp';

const { width: windowWidth, height: windowHeight } = Dimensions.get('window');

Expand Down Expand Up @@ -154,7 +155,9 @@ const Transfers: React.FC<TransfersProps> = ({
<TransferLineDot line={line} />
)}
<Text style={styles.lineName}>
{isJapanese ? line.name : line.nameR}
{isJapanese
? line.name.replace(parenthesisRegexp, '')
: line.nameR.replace(parenthesisRegexp, '')}
</Text>
</View>
);
Expand Down
13 changes: 10 additions & 3 deletions src/components/Transfers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import TransferLineMark from '../TransferLineMark';
import Heading from '../Heading';
import { isJapanese, translate } from '../../translation';
import AppTheme from '../../models/Theme';
import { parenthesisRegexp } from '../../constants/regexp';

const { isPad } = Platform as PlatformIOSStatic;

Expand Down Expand Up @@ -81,11 +82,17 @@ const Transfers: React.FC<Props> = ({ onPress, lines, theme }: Props) => {
)}
{isJapanese ? (
<View style={styles.lineNameContainer}>
<Text style={styles.lineName}>{line.name}</Text>
<Text style={styles.lineNameEn}>{line.nameR}</Text>
<Text style={styles.lineName}>
{line.name.replace(parenthesisRegexp, '')}
</Text>
<Text style={styles.lineNameEn}>
{line.nameR.replace(parenthesisRegexp, '')}
</Text>
</View>
) : (
<Text style={styles.lineName}>{line.nameR}</Text>
<Text style={styles.lineName}>
{line.nameR.replace(parenthesisRegexp, '')}
</Text>
)}
</View>
</View>
Expand Down
13 changes: 10 additions & 3 deletions src/components/TransfersYamanote/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { Line } from '../../models/StationAPI';
import TransferLineDot from '../TransferLineDot';
import TransferLineMark from '../TransferLineMark';
import { isJapanese, translate } from '../../translation';
import { parenthesisRegexp } from '../../constants/regexp';

const { isPad } = Platform as PlatformIOSStatic;

Expand Down Expand Up @@ -96,11 +97,17 @@ const TransfersYamanote: React.FC<Props> = ({ onPress, lines }: Props) => {
)}
{isJapanese ? (
<View style={styles.lineNameContainer}>
<Text style={styles.lineName}>{line.name}</Text>
<Text style={styles.lineNameEn}>{line.nameR}</Text>
<Text style={styles.lineName}>
{line.name.replace(parenthesisRegexp, '')}
</Text>
<Text style={styles.lineNameEn}>
{line.nameR.replace(parenthesisRegexp, '')}
</Text>
</View>
) : (
<Text style={styles.lineName}>{line.nameR}</Text>
<Text style={styles.lineName}>
{line.nameR.replace(parenthesisRegexp, '')}
</Text>
)}
</View>
</View>
Expand Down