From a702174910d4dcdef9c8cf5d593ac28d6a5e03a7 Mon Sep 17 00:00:00 2001 From: ErikSin <67773827+ErikSin@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:12:07 -0700 Subject: [PATCH] remove:save track header from stacked pr --- .../track/saveTrack/SaveTrackHeader.tsx | 98 ------------------- 1 file changed, 98 deletions(-) delete mode 100644 src/frontend/screens/MapScreen/track/saveTrack/SaveTrackHeader.tsx diff --git a/src/frontend/screens/MapScreen/track/saveTrack/SaveTrackHeader.tsx b/src/frontend/screens/MapScreen/track/saveTrack/SaveTrackHeader.tsx deleted file mode 100644 index 255c84cab..000000000 --- a/src/frontend/screens/MapScreen/track/saveTrack/SaveTrackHeader.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import React, {FC} from 'react'; -import {View, Image, StyleSheet, Pressable} from 'react-native'; -import {Text} from '../../../../sharedComponents/Text'; -import Close from '../../../../images/close.svg'; -import {useCreateTrack} from '../../../../hooks/server/track'; -import {useCurrentTrackStore} from '../../../../hooks/tracks/useCurrentTrackStore'; -import {DateTime} from 'luxon'; -import {TabName} from '../../../../Navigation/types'; -import {useNavigationFromHomeTabs} from '../../../../hooks/useNavigationWithTypes'; -import {defineMessages, useIntl} from 'react-intl'; - -const m = defineMessages({ - trackEditScreenTitle: { - id: 'screens.SaveTrack.TrackEditView.title', - defaultMessage: 'New Track', - description: 'Title for new track screen', - }, -}); - -export interface SaveTrackHeader { - openSheet: () => void; - description: string; -} - -export const SaveTrackHeader: FC = ({ - openSheet, - description, -}) => { - const saveTrack = useCreateTrack(); - const currentTrack = useCurrentTrackStore(); - const navigation = useNavigationFromHomeTabs(); - - const {formatMessage: t} = useIntl(); - - const handleSaveClick = () => { - saveTrack.mutate( - { - schemaName: 'track', - attachments: [], - refs: currentTrack.observations.map(observationId => ({ - id: observationId, - type: 'observation', - })), - tags: { - notes: description, - }, - locations: currentTrack.locationHistory.map(loc => { - return { - coords: { - latitude: loc.latitude, - longitude: loc.longitude, - }, - mocked: false, - timestamp: DateTime.fromMillis(loc.timestamp).toISO()!, - }; - }), - }, - { - onSuccess: () => { - navigation.navigate(TabName.Map); - currentTrack.clearCurrentTrack(); - }, - }, - ); - }; - return ( - - - - - - {t(m.trackEditScreenTitle)} - - - - - - ); -}; - -const styles = StyleSheet.create({ - container: { - borderBottomWidth: 1, - borderBottomColor: '#EDEDED', - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - paddingVertical: 10, - paddingHorizontal: 20, - }, - closeWrapper: {flexDirection: 'row', alignItems: 'center'}, - closeIcon: {width: 15, height: 15, marginRight: 20}, - text: {fontSize: 16, fontWeight: 'bold'}, - completeIcon: {width: 30, height: 30}, -});