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

48 lines
1.0 KiB
TypeScript
Raw 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';
2025-04-08 19:04:33 +00:00
import { useRouter } from 'expo-router';
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;
};
const t = i18n.scoped('timer.finishContent');
2024-10-13 11:29:36 +00:00
export default function FinishContent({
handleStart
}: FinishContentProps) {
2025-04-08 19:04:33 +00:00
const router = useRouter();
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} />
2025-04-08 19:04:33 +00:00
<Button label={i18n.t('back')} onPress={() => router.push('/')} />
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.white
}));