- TitleBar: ヘッダー高さをverticalScaleに - UsefulBox: アイコン50→moderateScale、フォント16→fontScale - TicketBox: フォント18→fontScale - TextBox: minHeight 70→verticalScale - FixedContentBottom: 全fontSize(20/18)→fontScale、全アイコンsize(50/40)→moderateScale - JRSTraInfoBox: 全fontSize(30/20/18)、アイコン、maxHeight、ローディングサイズをスケーリング - SpecialTrainInfoBox: fontSize(30/20)→fontScale - CarouselTypeChanger: height 40→verticalScale
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import React, { FC } from "react";
|
|
import { Text, TouchableOpacity } from "react-native";
|
|
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
|
import { useThemeColors } from "@/lib/theme";
|
|
import { useResponsive } from "@/lib/responsive";
|
|
|
|
type Props = {
|
|
icon: keyof typeof MaterialCommunityIcons.glyphMap;
|
|
backgroundColor: string;
|
|
flex: number;
|
|
onPressButton: () => void;
|
|
children: string;
|
|
};
|
|
|
|
export const UsefulBox: FC<Props> = (props) => {
|
|
const { icon, backgroundColor, flex, onPressButton, children } = props;
|
|
const { fixed } = useThemeColors();
|
|
const { fontScale, moderateScale } = useResponsive();
|
|
return (
|
|
<TouchableOpacity
|
|
style={{
|
|
flex: flex,
|
|
backgroundColor: backgroundColor,
|
|
padding: 5,
|
|
alignItems: "center",
|
|
margin: 2,
|
|
}}
|
|
onPress={onPressButton}
|
|
>
|
|
<MaterialCommunityIcons name={icon} color={fixed.textOnPrimary} size={moderateScale(50)} />
|
|
<Text style={{ color: fixed.textOnPrimary, fontWeight: "bold", fontSize: fontScale(16) }}>
|
|
{children}
|
|
</Text>
|
|
</TouchableOpacity>
|
|
);
|
|
};
|