Files
jrshikoku/components/atom/TicketBox.tsx
harukin-expo-dev-env 82f3a20203 feat: メイン画面のレスポンシブ対応 - Menu/atom/TrainMenuコンポーネントにスケーリング適用
- 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
2026-03-29 15:41:06 +00:00

38 lines
954 B
TypeScript

import { TouchableOpacity, Text } from "react-native";
import { useThemeColors } from "@/lib/theme";
import { useResponsive } from "@/lib/responsive";
export const TicketBox = (props) => {
const { colors, fixed } = useThemeColors();
const { fontScale } = useResponsive();
const {
icon,
backgroundColor,
flex,
onPressButton,
children,
onLongPressButton,
} = props;
return (
<TouchableOpacity
style={{
flex: flex,
backgroundColor: backgroundColor,
borderColor: colors.iconAccent,
padding: 10,
borderWidth: 1,
margin: 2,
alignItems: "center",
justifyContent: "center",
}}
onPress={onPressButton}
onLongPress={onLongPressButton}
>
<Text style={{ color: fixed.textOnPrimary, fontWeight: "bold", fontSize: fontScale(18), textAlign: "center" }}>
{children}
</Text>
{icon}
</TouchableOpacity>
);
};