diff --git a/mobile/components/Master.tsx b/mobile/components/Layout.tsx similarity index 95% rename from mobile/components/Master.tsx rename to mobile/components/Layout.tsx index 4c4d4a4e..de3115be 100644 --- a/mobile/components/Master.tsx +++ b/mobile/components/Layout.tsx @@ -4,13 +4,13 @@ import type { NativeStackNavigationProp } from '@react-navigation/native-stack' import { RouteProp } from '@react-navigation/native' import * as UserService from '../services/UserService' -import Button from '../components/Button' +import Button from './Button' import i18n from '../lang/i18n' import * as helper from '../common/helper' -import Header from '../components/Header' +import Header from './Header' import * as movininTypes from ':movinin-types' -interface MasterProps { +interface LayoutProps { navigation: NativeStackNavigationProp strict?: boolean route?: RouteProp @@ -23,7 +23,7 @@ interface MasterProps { onLoad: (user?: movininTypes.User) => void } -const Master = ({ +const Layout = ({ navigation, strict, route, @@ -34,7 +34,7 @@ const Master = ({ avatar, children, onLoad -}: MasterProps) => { +}: LayoutProps) => { const [loading, setLoading] = useState(true) const [user, setUser] = useState(null) const [loggedIn, setLoggedIn] = useState(false) @@ -164,4 +164,4 @@ const styles = StyleSheet.create({ }, }) -export default Master +export default Layout diff --git a/mobile/screens/AboutScreen.tsx b/mobile/screens/AboutScreen.tsx index 56e11b47..5e849065 100644 --- a/mobile/screens/AboutScreen.tsx +++ b/mobile/screens/AboutScreen.tsx @@ -5,7 +5,7 @@ import { useIsFocused } from '@react-navigation/native' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' -import Master from '../components/Master' +import Layout from '../components/Layout' const AboutScreen = ({ navigation, route }: NativeStackScreenProps) => { const isFocused = useIsFocused() @@ -33,13 +33,13 @@ const AboutScreen = ({ navigation, route }: NativeStackScreenProps + {visible && ( About! )} - + ) } diff --git a/mobile/screens/BookingScreen.tsx b/mobile/screens/BookingScreen.tsx index df50c02c..3b79f66f 100644 --- a/mobile/screens/BookingScreen.tsx +++ b/mobile/screens/BookingScreen.tsx @@ -6,7 +6,7 @@ import * as movininTypes from ':movinin-types' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' -import Master from '../components/Master' +import Layout from '../components/Layout' import BookingList from '../components/BookingList' import * as env from '../config/env.config' @@ -55,7 +55,7 @@ const BookingScreen = ({ navigation, route }: NativeStackScreenProps + {visible && ( )} - + ) } diff --git a/mobile/screens/BookingsScreen.tsx b/mobile/screens/BookingsScreen.tsx index c764ff85..fa04de78 100644 --- a/mobile/screens/BookingsScreen.tsx +++ b/mobile/screens/BookingsScreen.tsx @@ -4,7 +4,7 @@ import { useIsFocused } from '@react-navigation/native' import { NativeStackScreenProps } from '@react-navigation/native-stack' import * as movininTypes from ':movinin-types' -import Master from '../components/Master' +import Layout from '../components/Layout' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' import BookingList from '../components/BookingList' @@ -96,7 +96,7 @@ const BookingsScreen = ({ navigation, route }: NativeStackScreenProps + {visible && user?._id && ( )} - + ) } diff --git a/mobile/screens/ChangePasswordScreen.tsx b/mobile/screens/ChangePasswordScreen.tsx index d1906747..83da9946 100644 --- a/mobile/screens/ChangePasswordScreen.tsx +++ b/mobile/screens/ChangePasswordScreen.tsx @@ -9,7 +9,7 @@ import { useIsFocused } from '@react-navigation/native' import { NativeStackScreenProps } from '@react-navigation/native-stack' // import * as movininTypes from ':movinin-types' -import Master from '../components/Master' +import Layout from '../components/Layout' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' // import * as helper from '../common/helper' @@ -194,7 +194,7 @@ const ChangePasswordScreen = ({ navigation, route }: NativeStackScreenProps + {visible && ( @@ -247,7 +247,7 @@ const ChangePasswordScreen = ({ navigation, route }: NativeStackScreenProps )} - + ) } diff --git a/mobile/screens/Checkout.tsx b/mobile/screens/Checkout.tsx index 6f15f751..ca70fc75 100644 --- a/mobile/screens/Checkout.tsx +++ b/mobile/screens/Checkout.tsx @@ -17,7 +17,7 @@ import { PaymentSheetError, initPaymentSheet, useStripe } from '@stripe/stripe-r import * as movininTypes from ':movinin-types' import * as movininHelper from ':movinin-helper' -import Master from '../components/Master' +import Layout from '../components/Layout' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' import TextInput from '../components/TextInput' @@ -522,7 +522,7 @@ const CheckoutScreen = ({ navigation, route }: NativeStackScreenProps + {visible && property && from && to && location && ( <> {formVisible && ( @@ -695,7 +695,7 @@ const CheckoutScreen = ({ navigation, route }: NativeStackScreenProps} )} - + ) } diff --git a/mobile/screens/ContactScreen.tsx b/mobile/screens/ContactScreen.tsx index d8e5b099..4427fa90 100644 --- a/mobile/screens/ContactScreen.tsx +++ b/mobile/screens/ContactScreen.tsx @@ -5,7 +5,7 @@ import { NativeStackScreenProps } from '@react-navigation/native-stack' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' -import Master from '../components/Master' +import Layout from '../components/Layout' const ContactScreen = ({ navigation, route }: NativeStackScreenProps) => { const isFocused = useIsFocused() @@ -33,13 +33,13 @@ const ContactScreen = ({ navigation, route }: NativeStackScreenProps + {visible && ( Contact! )} - + ) } diff --git a/mobile/screens/HomeScreen.tsx b/mobile/screens/HomeScreen.tsx index ab88ec3f..4391ded3 100644 --- a/mobile/screens/HomeScreen.tsx +++ b/mobile/screens/HomeScreen.tsx @@ -14,7 +14,7 @@ import * as env from '../config/env.config' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' import * as helper from '../common/helper' -import Master from '../components/Master' +import Layout from '../components/Layout' import Button from '../components/Button' import LocationSelectList from '../components/LocationSelectList' import DateTimePicker from '../components/DateTimePicker' @@ -107,7 +107,7 @@ const HomeScreen = ({ navigation, route }: NativeStackScreenProps + {init && visible && ( @@ -199,7 +199,7 @@ const HomeScreen = ({ navigation, route }: NativeStackScreenProps )} - + ) } diff --git a/mobile/screens/NotificationsScreen.tsx b/mobile/screens/NotificationsScreen.tsx index 5a269aeb..dd3746c2 100644 --- a/mobile/screens/NotificationsScreen.tsx +++ b/mobile/screens/NotificationsScreen.tsx @@ -7,7 +7,7 @@ import * as movininTypes from ':movinin-types' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' -import Master from '../components/Master' +import Layout from '../components/Layout' import NotificationList from '../components/NotificationList' const NotificationsScreen = ({ navigation, route }: NativeStackScreenProps) => { @@ -55,11 +55,11 @@ const NotificationsScreen = ({ navigation, route }: NativeStackScreenProps + {visible && ( )} - + ) } diff --git a/mobile/screens/PropertiesScreen.tsx b/mobile/screens/PropertiesScreen.tsx index c6c19c65..a68f7765 100644 --- a/mobile/screens/PropertiesScreen.tsx +++ b/mobile/screens/PropertiesScreen.tsx @@ -5,7 +5,7 @@ import { NativeStackScreenProps } from '@react-navigation/native-stack' import * as movininTypes from ':movinin-types' import * as movininHelper from ':movinin-helper' -import Master from '../components/Master' +import Layout from '../components/Layout' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' import PropertyList from '../components/PropertyList' @@ -59,7 +59,7 @@ const PropertiesScreen = ({ navigation, route }: NativeStackScreenProps + {visible && ( )} - + ) } diff --git a/mobile/screens/SettingsScreen.tsx b/mobile/screens/SettingsScreen.tsx index 978d021f..f54497a6 100644 --- a/mobile/screens/SettingsScreen.tsx +++ b/mobile/screens/SettingsScreen.tsx @@ -21,7 +21,7 @@ import { intervalToDuration } from 'date-fns' import * as movininTypes from ':movinin-types' import * as movininHelper from ':movinin-helper' -import Master from '../components/Master' +import Layout from '../components/Layout' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' import TextInput from '../components/TextInput' @@ -243,7 +243,7 @@ const SettingsScreen = ({ navigation, route }: NativeStackScreenProps + {visible && language && ( <> @@ -413,7 +413,7 @@ const SettingsScreen = ({ navigation, route }: NativeStackScreenProps )} - + ) } diff --git a/mobile/screens/ToSScreen.tsx b/mobile/screens/ToSScreen.tsx index c6a6ac65..e15e86dc 100644 --- a/mobile/screens/ToSScreen.tsx +++ b/mobile/screens/ToSScreen.tsx @@ -5,7 +5,7 @@ import { NativeStackScreenProps } from '@react-navigation/native-stack' import i18n from '../lang/i18n' import * as UserService from '../services/UserService' -import Master from '../components/Master' +import Layout from '../components/Layout' const ToSScreen = ({ navigation, route }: NativeStackScreenProps) => { const isFocused = useIsFocused() @@ -34,13 +34,13 @@ const ToSScreen = ({ navigation, route }: NativeStackScreenProps + {visible && ( ToS! )} - + ) }