Skip to content

Commit

Permalink
2️⃣ Chapter 2.1: Home tab stack
Browse files Browse the repository at this point in the history
  • Loading branch information
nandorojo committed Oct 7, 2022
1 parent e7ccf17 commit 8970290
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/expo/app/(tabs).tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function MyTabs() {
}}
>
<Tabs.Screen
name="index"
name="(home)"
options={{
title: 'Home',
tabBarIcon({ color, size, focused }) {
Expand Down
27 changes: 27 additions & 0 deletions apps/expo/app/(tabs)/(home).tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { NativeStack as Stack } from 'expo-router'
import { useDripsyTheme } from 'dripsy'

export default function MyStack({ children }) {
const { colors } = useDripsyTheme().theme
return (
<Stack
screenOptions={{
headerStyle: {
backgroundColor: colors.$background2,
},
headerTitleStyle: {
color: colors.$text,
},
headerTintColor: '#D864D8',
headerShadowVisible: false,
}}
>
<Stack.Screen
name="index"
options={{
title: 'Home',
}}
/>
</Stack>
)
}
File renamed without changes.
2 changes: 1 addition & 1 deletion apps/expo/app/(tabs)/users.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NativeStack as Stack } from 'expo-router'
import { useDripsyTheme } from 'dripsy'

export default function MyStack() {
export default function MyStack({ children }) {
const { colors } = useDripsyTheme().theme
return (
<Stack
Expand Down
9 changes: 2 additions & 7 deletions packages/app/features/user/detail-screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ export function UserDetailScreen() {
bg: '$background',
}}
>
<Link href="/">
<Text sx={{ textAlign: 'center' }}>
{`User ID:`}{' '}
<Text sx={{ bg: '$purple3', px: '$1', borderRadius: '$1' }}>
{id}
</Text>
</Text>
<Link href="/users">
<Text sx={{ bg: '$purple3', px: '$2', py: '$2' }}>{id}</Text>
</Link>
</View>
)
Expand Down

0 comments on commit 8970290

Please sign in to comment.