boxons/components/useCases/timer/view/FinishContent.tsx

55 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2025-04-08 19:04:33 +00:00
import React from 'react';
2024-10-13 11:29:36 +00:00
import { Text, View } from '@/components/shared/Themed';
import styled from '@emotion/native';
import { useNavigation } from '@react-navigation/native';
2024-10-13 11:29:36 +00:00
import Button from '@/components/shared/Button';
import { HorizontalSpacer, VerticalSpacer } from '@/components/shared/Spacers';
import { i18n } from '@/app/i18n/i18n';
2024-10-13 11:29:36 +00:00
type FinishContentProps = {
handleStart: () => void;
handleReset: () => void;
2024-10-13 11:29:36 +00:00
};
const t = i18n.scoped('timer.finishContent');
2024-10-13 11:29:36 +00:00
export default function FinishContent({
handleStart,
handleReset
2024-10-13 11:29:36 +00:00
}: FinishContentProps) {
const navigation = useNavigation();
2024-10-13 11:29:36 +00:00
const handleBackClick = () => {
navigation.goBack();
handleReset();
};
2024-10-13 11:29:36 +00:00
return (
<>
<Time>{t('finish')}</Time>
2024-10-13 11:29:36 +00:00
<VerticalSpacer heightUnits={8} />
<Row>
<Button label={t('restart')} onPress={handleStart} />
2024-10-13 11:29:36 +00:00
<HorizontalSpacer widthUnits={3} />
<Button label={i18n.t('back')} onPress={handleBackClick} />
2024-10-13 11:29:36 +00:00
</Row>
</>
);
}
const Row = styled(View)(() => ({
flexDirection: 'row',
backgroundColor: 'black'
}));
const Time = styled(Text)(({ theme }) => ({
fontSize: 70,
2024-10-13 11:29:36 +00:00
fontWeight: 'bold',
color: theme.colors.fixed.white
2024-10-13 11:29:36 +00:00
}));