Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/andrew-bierman/PackRat
Browse files Browse the repository at this point in the history
… into server_types
  • Loading branch information
pinocchio-life-like committed Dec 28, 2024
2 parents 46c029d + 548210d commit 9070228
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 32 deletions.
7 changes: 5 additions & 2 deletions apps/expo/app/(app)/(drawer)/(tabs)/(stack)/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { DrawerToggleButton } from '@react-navigation/drawer';
import { useRouterSettings } from 'app/hooks/router';
import { Stack } from 'expo-router';
import React from 'react';

import useTheme from 'app/hooks/useTheme';
export default function StackLayout() {
const { layoutStackScreenOptionsHeaderSettings } = useRouterSettings();
const { currentTheme } = useTheme();
return (
<Stack
screenOptions={{
headerRight: () => <DrawerToggleButton />,
headerRight: () => (
<DrawerToggleButton tintColor={currentTheme.colors.text} />
),
...layoutStackScreenOptionsHeaderSettings,
headerBlurEffect: 'systemChromeMaterial',
}}
Expand Down
4 changes: 2 additions & 2 deletions apps/expo/app/(app)/(drawer)/(tabs)/(stack)/about/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export default function AboutRoute() {
backgroundColor: currentTheme.colors.background,
},
headerTitleStyle: {
fontSize: 24,
fontSize: 20,
},
headerTintColor: currentTheme.colors.tertiaryBlue,
headerTintColor: currentTheme.colors.text,
// https://reactnavigation.org/docs/headers#adjusting-header-styles

// https://reactnavigation.org/docs/headers#replacing-the-title-with-a-custom-component
Expand Down
16 changes: 12 additions & 4 deletions apps/expo/app/(app)/(drawer)/(tabs)/(stack)/maps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { DrawerToggleButton } from '@react-navigation/drawer';
import useTheme from 'app/hooks/useTheme';
import { OfflineMapsScreen } from 'app/modules/map/screens/OfflineMapsScreen';
import { Stack } from 'expo-router';
import { placesAutocompleteSearchAtom } from 'app/components/PlacesAutocomplete/usePlacesAutoComplete';
import { useAtom } from 'jotai';
import Head from 'expo-router/head';
import React from 'react';
import { Platform } from 'react-native';

export default function MapsScreen() {
const { currentTheme } = useTheme();

const [searchQuery, setSearchQuery] = useAtom(placesAutocompleteSearchAtom);
return (
<>
{Platform.OS === 'web' && (
Expand All @@ -23,14 +25,20 @@ export default function MapsScreen() {
headerRight: ({ tintColor }) => (
<DrawerToggleButton tintColor={tintColor} />
),

headerSearchBarOptions: {
placeholder: 'Search maps',
hideWhenScrolling: false,
headerIconColor: currentTheme.colors.text,
inputType: 'text',
onChangeText: (e) => setSearchQuery(e.nativeEvent.text),
},
headerStyle: {
backgroundColor: currentTheme.colors.background,
},
headerTitleStyle: {
fontSize: 24,
fontSize: 20,
},
headerTintColor: currentTheme.colors.tertiaryBlue,
headerTintColor: currentTheme.colors.text,
// https://reactnavigation.org/docs/headers#adjusting-header-styles

// https://reactnavigation.org/docs/headers#replacing-the-title-with-a-custom-component
Expand Down
15 changes: 12 additions & 3 deletions apps/expo/app/(app)/(drawer)/(tabs)/(stack)/products/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { DrawerToggleButton } from '@react-navigation/drawer';
import useTheme from 'app/hooks/useTheme';
import { ProductsScreen } from 'app/modules/item';
import { placesAutocompleteSearchAtom } from 'app/components/PlacesAutocomplete/usePlacesAutoComplete';
import { useAtom } from 'jotai';
import { Stack } from 'expo-router';
import Head from 'expo-router/head';
import React from 'react';
import { Platform } from 'react-native';

export default function ProductsPage() {
const { currentTheme } = useTheme();

const [searchQuery, setSearchQuery] = useAtom(placesAutocompleteSearchAtom);
return (
<>
{Platform.OS === 'web' && (
Expand All @@ -23,14 +25,21 @@ export default function ProductsPage() {
headerRight: ({ tintColor }) => (
<DrawerToggleButton tintColor={tintColor} />
),
headerSearchBarOptions: {
placeholder: 'Search products',
headerIconColor: currentTheme.colors.text,
hideWhenScrolling: false,
inputType: 'text',
onChangeText: (e) => setSearchQuery(e.nativeEvent.text),
},

headerStyle: {
backgroundColor: currentTheme.colors.background,
},
headerTitleStyle: {
fontSize: 24,
fontSize: 20,
},
headerTintColor: currentTheme.colors.tertiaryBlue,
headerTintColor: currentTheme.colors.text,
// https://reactnavigation.org/docs/headers#adjusting-header-styles

// https://reactnavigation.org/docs/headers#replacing-the-title-with-a-custom-component
Expand Down
14 changes: 13 additions & 1 deletion apps/expo/app/(app)/(drawer)/(tabs)/(stack)/trips/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { FeedScreen } from 'app/modules/feed';
import { placesAutocompleteSearchAtom } from 'app/components/PlacesAutocomplete/usePlacesAutoComplete';
import { useAtom } from 'jotai';
import { Platform } from 'react-native';
import { Stack } from 'expo-router';
import Head from 'expo-router/head';

import useTheme from 'app/hooks/useTheme';
export default function FeedNav() {
const { currentTheme } = useTheme();
const [searchQuery, setSearchQuery] = useAtom(placesAutocompleteSearchAtom);

return (
<>
{Platform.OS === 'web' && (
Expand All @@ -16,6 +21,13 @@ export default function FeedNav() {
options={{
// https://reactnavigation.org/docs/headers#setting-the-header-title
title: 'Trips',
headerSearchBarOptions: {
placeholder: 'Search trips',
headerIconColor: currentTheme.colors.text,
hideWhenScrolling: false,
inputType: 'text',
onChangeText: (e) => setSearchQuery(e.nativeEvent.text),
},
// https://reactnavigation.org/docs/headers#adjusting-header-styles

// https://reactnavigation.org/docs/headers#replacing-the-title-with-a-custom-component
Expand Down
6 changes: 4 additions & 2 deletions apps/expo/app/(app)/(drawer)/(tabs)/feed/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ export default function FeedNav() {
options={{
// https://reactnavigation.org/docs/headers#setting-the-header-title
title: 'Feed',
headerRight: ({ tintColor }) => (
<DrawerToggleButton tintColor={tintColor} />
headerRight: () => (
<DrawerToggleButton tintColor={currentTheme.colors.text} />
),
headerSearchBarOptions: {
placeholder: 'Search',
headerIconColor: currentTheme.colors.text,

hideWhenScrolling: false,
inputType: 'text',
onChangeText: (e) => setSearchQuery(e.nativeEvent.text),
Expand Down
7 changes: 5 additions & 2 deletions apps/expo/app/(app)/(drawer)/(tabs)/index/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { DrawerToggleButton } from '@react-navigation/drawer';
import { useRouterSettings } from 'app/hooks/router';
import { Stack } from 'expo-router';
import React from 'react';

import useTheme from 'app/hooks/useTheme';
export default function StackLayout() {
const { layoutStackScreenOptionsHeaderSettings } = useRouterSettings();
const { currentTheme } = useTheme();
return (
<Stack
screenOptions={{
headerRight: () => <DrawerToggleButton />,
headerRight: () => (
<DrawerToggleButton tintColor={currentTheme.colors.text} />
),
...layoutStackScreenOptionsHeaderSettings,
headerBlurEffect: 'systemChromeMaterial',
}}
Expand Down
6 changes: 0 additions & 6 deletions apps/expo/app/(app)/(drawer)/(tabs)/index/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ export default function HomeScreen() {
<Stack.Screen
options={{
title: 'Home',
headerSearchBarOptions: {
placeholder: 'Search by park, city, or trail',
hideWhenScrolling: false,
inputType: 'text',
onChangeText: (e) => setSearchQuery(e.nativeEvent.text),
},
}}
/>
{connectionStatus === 'connected' && (
Expand Down
7 changes: 5 additions & 2 deletions apps/expo/app/(app)/(drawer)/(tabs)/packs/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import { DrawerToggleButton } from '@react-navigation/drawer';
import { useRouterSettings } from 'app/hooks/router';
import { Stack } from 'expo-router';
import React from 'react';

import useTheme from 'app/hooks/useTheme';
export default function StackLayout() {
const { currentTheme } = useTheme();
const { layoutStackScreenOptionsHeaderSettings } = useRouterSettings();
return (
<Stack
screenOptions={{
headerRight: () => <DrawerToggleButton />,
headerRight: () => (
<DrawerToggleButton tintColor={currentTheme.colors.text} />
),
...layoutStackScreenOptionsHeaderSettings,
headerBlurEffect: 'systemChromeMaterial',
}}
Expand Down
11 changes: 11 additions & 0 deletions apps/expo/app/(app)/(drawer)/(tabs)/packs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { DrawerToggleButton } from '@react-navigation/drawer';
import { placesAutocompleteSearchAtom } from 'app/components/PlacesAutocomplete/usePlacesAutoComplete';
import useTheme from 'app/hooks/useTheme';
import { FeedScreen } from 'app/modules/feed';
import { Stack } from 'expo-router';
import Head from 'expo-router/head';
import { useAtom } from 'jotai';
import React from 'react';
import { Platform } from 'react-native';

export default function Packs() {
const { currentTheme } = useTheme();
const [searchQuery, setSearchQuery] = useAtom(placesAutocompleteSearchAtom);

return (
<>
Expand All @@ -20,6 +23,14 @@ export default function Packs() {
options={{
// https://reactnavigation.org/docs/headers#setting-the-header-title
title: 'Packs',
headerSearchBarOptions: {
placeholder: 'Search packs',
headerIconColor: currentTheme.colors.text,
hideWhenScrolling: false,
inputType: 'text',
onChangeText: (e) => setSearchQuery(e.nativeEvent.text),
},

headerRight: ({ tintColor }) => (
<DrawerToggleButton tintColor={tintColor} />
),
Expand Down
6 changes: 5 additions & 1 deletion apps/expo/app/(app)/(drawer)/(tabs)/profile/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ import { DrawerToggleButton } from '@react-navigation/drawer';
import { useRouterSettings } from 'app/hooks/router';
import { Stack } from 'expo-router';
import React from 'react';
import useTheme from 'app/hooks/useTheme';

export default function StackLayout() {
const { currentTheme } = useTheme();
return (
<Stack
screenOptions={{
headerRight: () => <DrawerToggleButton />,
headerRight: () => (
<DrawerToggleButton tintColor={currentTheme.colors.text} />
),
headerBlurEffect: 'systemChromeMaterial',
title: 'Profile',
}}
Expand Down
10 changes: 5 additions & 5 deletions packages/app/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import React from 'react';
import { Platform, SafeAreaView } from 'react-native';
import { ScrollView, Stack, YStack } from 'tamagui';

type LayoutProps = {
interface LayoutProps {
children: React.ReactNode;
customStyle?: Record<string, any>;
};
}

const Layout: React.FC<LayoutProps> = ({ children, customStyle = {} }) => {
const { currentTheme } = useTheme();
Expand All @@ -16,14 +16,14 @@ const Layout: React.FC<LayoutProps> = ({ children, customStyle = {} }) => {
<YStack
flex={1}
backgroundColor={currentTheme.colors.background}
maxWidth={1440}
maxWidth={Platform.OS === 'web' ? 1440 : 400}
margin="auto"
alignItems="center"
justifyContent="flex-start"
paddingTop={Platform.OS === 'web' ? 20 : '$2'}
paddingTop={Platform.OS === 'web' ? 20 : '$1'}
paddingBottom={Platform.OS !== 'web' ? 44 : undefined}
paddingHorizontal="$4"
marginBottom={Platform.OS === 'web' ? 20 : '$2'}
marginBottom={Platform.OS === 'web' ? 20 : '$1'}
width="100%"
{...customStyle}
>
Expand Down
4 changes: 2 additions & 2 deletions packages/app/screens/about/about.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const loadStyles = (theme: any) => {
header: {
fontSize: 24,
fontWeight: 'bold',
color: currentTheme.colors.tertiaryBlue,
color: currentTheme.colors.text,
marginRight: 10,
},
headerDark: {
Expand Down Expand Up @@ -83,7 +83,7 @@ const loadStyles = (theme: any) => {
lineHeight: 28,
letterSpacing: 1,
// fontFamily: "sans-serif",
color: currentTheme.colors.tertiaryBlue,
color: currentTheme.colors.text,
marginBottom: 20,
},
tertiaryBlue: {
Expand Down

0 comments on commit 9070228

Please sign in to comment.