-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
136 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Provider } from 'app/provider' | ||
import { StatusBar } from 'expo-status-bar' | ||
import { Tabs } from 'expo-router' | ||
import { useDripsyTheme } from 'dripsy' | ||
import { Ionicons } from '@expo/vector-icons' | ||
|
||
function MyTabs() { | ||
const { colors } = useDripsyTheme().theme | ||
return ( | ||
<Tabs | ||
screenOptions={{ | ||
headerShown: false, | ||
tabBarStyle: { | ||
backgroundColor: colors.$background2, | ||
borderTopWidth: 0, | ||
}, | ||
tabBarActiveTintColor: '#F65CB6', | ||
}} | ||
> | ||
<Tabs.Screen | ||
name="index" | ||
options={{ | ||
title: 'Home', | ||
tabBarIcon({ color, size, focused }) { | ||
return ( | ||
<Ionicons | ||
name={focused ? 'home' : 'home-outline'} | ||
size={size} | ||
color={color} | ||
/> | ||
) | ||
}, | ||
}} | ||
/> | ||
<Tabs.Screen | ||
name="users" | ||
options={{ | ||
title: 'Users', | ||
tabBarIcon({ color, size, focused }) { | ||
return ( | ||
<Ionicons | ||
name={focused ? 'people' : 'people-outline'} | ||
size={size} | ||
color={color} | ||
/> | ||
) | ||
}, | ||
}} | ||
/> | ||
</Tabs> | ||
) | ||
} | ||
|
||
export default function Root() { | ||
return ( | ||
<Provider> | ||
<MyTabs /> | ||
<StatusBar style="light" /> | ||
</Provider> | ||
) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'app/features/user/list-screen' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from 'app/features/user/list-screen' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { View, Image, ScrollView, Text } from 'dripsy' | ||
import { Link } from 'solito/link' | ||
import { Fragment } from 'react' | ||
|
||
const users = [ | ||
{ | ||
id: 'Guillermo Rauch', | ||
avatar: | ||
'https://pbs.twimg.com/profile_images/1576257734810312704/ucxb4lHy_400x400.jpg', | ||
}, | ||
{ | ||
id: 'Charlie Cheever', | ||
avatar: | ||
'https://pbs.twimg.com/profile_images/418503340872306688/cwVZFE3e_400x400.jpeg', | ||
}, | ||
{ | ||
id: 'Fernando Rojo', | ||
avatar: | ||
'https://pbs.twimg.com/profile_images/1182392379761987591/9XPy4NfP_400x400.jpg', | ||
}, | ||
{ | ||
id: 'Evan Bacon', | ||
avatar: | ||
'https://pbs.twimg.com/profile_images/1576625400205250561/wGfn72X__400x400.jpg', | ||
}, | ||
] | ||
|
||
export default function UsersListScreen() { | ||
return ( | ||
<ScrollView sx={{ flex: 1, bg: '$background' }}> | ||
<View sx={{ p: '$3', width: '100%', maxWidth: 800, alignSelf: 'center' }}> | ||
{users.map((user) => { | ||
return ( | ||
<Fragment key={user.id}> | ||
<Link href={`/users/${user.id}`}> | ||
<View | ||
sx={{ | ||
mb: '$3', | ||
flexDirection: 'row', | ||
}} | ||
> | ||
<Image | ||
source={{ uri: user.avatar, cache: 'force-cache' }} | ||
sx={{ | ||
size: 50, | ||
borderRadius: '$rounded', | ||
mr: '$3', | ||
}} | ||
{...{ | ||
alt: `${user.id}'s avatar`, | ||
accessibilityLabel: `${user.id}'s avatar`, | ||
}} | ||
/> | ||
|
||
<View sx={{ flex: 1, justifyContent: 'center' }}> | ||
<Text sx={{ fontWeight: '600', fontSize: 14 }}> | ||
{user.id} | ||
</Text> | ||
</View> | ||
</View> | ||
</Link> | ||
</Fragment> | ||
) | ||
})} | ||
</View> | ||
</ScrollView> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters