From a9d72e8c998d63dfb0b960467f148a2aa5caa3ca Mon Sep 17 00:00:00 2001 From: Anmol Verma Date: Sat, 27 Apr 2024 22:40:25 +0530 Subject: [PATCH] Add back feature to trip and profile settings --- .../card/TripCardHeader/TripCardHeader.tsx | 35 +++++++++++++++++-- packages/app/screens/user/Settings.tsx | 31 ++++++++++++++-- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/packages/app/components/card/TripCardHeader/TripCardHeader.tsx b/packages/app/components/card/TripCardHeader/TripCardHeader.tsx index 106354fef..7ecdcf60d 100644 --- a/packages/app/components/card/TripCardHeader/TripCardHeader.tsx +++ b/packages/app/components/card/TripCardHeader/TripCardHeader.tsx @@ -1,12 +1,43 @@ import React from 'react'; - +import {Text} from "react-native"; +import { useRouter } from 'app/hooks/router'; +import useTheme from 'app/hooks/useTheme'; import { CustomCardHeader } from '../CustomCardHeader'; +import { RIconButton, RStack } from '@packrat/ui'; +import { AntDesign } from '@expo/vector-icons'; export const TripCardHeader = ({ data, title, link }) => { + + const { currentTheme } = useTheme(); + const router = useRouter(); + return ( + + } + onPress={()=>{ + router.back(); + }} + /> + + {title} + + } link={link} actionsComponent={undefined} /> diff --git a/packages/app/screens/user/Settings.tsx b/packages/app/screens/user/Settings.tsx index 7bd3e10a6..c42df7a5d 100644 --- a/packages/app/screens/user/Settings.tsx +++ b/packages/app/screens/user/Settings.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Ionicons } from '@expo/vector-icons'; +import { AntDesign, Ionicons } from '@expo/vector-icons'; import { RInput, RSeparator, @@ -15,9 +15,12 @@ import { FormInput, FormSelect, SubmitButton, + RIconButton, } from '@packrat/ui'; import Avatar from 'app/components/Avatar/Avatar'; import { useProfileSettings } from 'app/hooks/user'; +import { useRouter } from 'app/hooks/router'; +import useTheme from 'app/hooks/useTheme'; import { userSettingsSchema, passwordChangeSchema } from '@packrat/validations'; const weatherOptions = ['celsius', 'fahrenheit'].map((key) => ({ @@ -34,6 +37,9 @@ export default function Settings() { const { user, handleEditUser, handlePasswordsChange, handleUpdatePassword } = useProfileSettings(); + const { currentTheme } = useTheme(); + const router = useRouter(); + return user ? ( - + + + } + onPress={()=>{ + router.back(); + }} + /> Profile - +