Skip to content

Commit

Permalink
0.2.34
Browse files Browse the repository at this point in the history
  • Loading branch information
hyochan committed Jun 30, 2024
1 parent 1972d7a commit 772de92
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 76 deletions.
56 changes: 56 additions & 0 deletions app/(app)/(tabs)/_layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import {Pressable, View} from 'react-native';
import {Icon, useDooboo} from 'dooboo-ui';
import {Link, Tabs, useRouter} from 'expo-router';

function SettingsMenu(): JSX.Element {
const {theme} = useDooboo();
const {push} = useRouter();

return (
<Link asChild href="/modal">
<Pressable onPress={() => push('settings')}>
{({pressed}) => (
<Icon
color={theme.text.basic}
name="List"
size={22}
style={{marginRight: 15, opacity: pressed ? 0.5 : 1}}
/>
)}
</Pressable>
</Link>
);
}

export default function TabLayout(): JSX.Element {
const {theme} = useDooboo();

return (
<Tabs
screenOptions={{
tabBarActiveTintColor: theme.role.primary,
}}
>
<Tabs.Screen
name="index"
options={{
title: '커뮤니티',
tabBarIcon: () => (
<Icon color={theme.text.label} name="Article" size={24} />
),
headerRight: () => <View>{SettingsMenu()}</View>,
}}
/>
<Tabs.Screen
name="profile"
options={{
title: '프로필',
tabBarIcon: () => (
<Icon color={theme.text.label} name="User" size={24} />
),
headerRight: () => <View>{SettingsMenu()}</View>,
}}
/>
</Tabs>
);
}
29 changes: 29 additions & 0 deletions app/(app)/(tabs)/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {View} from 'react-native';

Check warning on line 1 in app/(app)/(tabs)/index.tsx

View workflow job for this annotation

GitHub Actions / build

'View' is defined but never used. Allowed unused vars must match /^_/u
import styled, {css} from '@emotion/native';
import {Fab, Typography} from 'dooboo-ui';
import {Stack} from 'expo-router';

const Container = styled.View`
flex: 1;
align-self: stretch;
background-color: ${({theme}) => theme.bg.basic};
`;

export default function Community(): JSX.Element {
return (
<Container>
<Stack.Screen options={{title: '커뮤니티'}} />
<Typography.Heading3>커뮤니티</Typography.Heading3>
<Fab

Check failure on line 17 in app/(app)/(tabs)/index.tsx

View workflow job for this annotation

GitHub Actions / build

Type '{ animationDuration: number; fabIcon: "Plus"; onPressFab: () => void; style: any; }' is missing the following properties from type 'FabProps': isActive, icons, onPressItem
animationDuration={300}
fabIcon="Plus"
onPressFab={() => {
console.log('onPressFab');

Check warning on line 21 in app/(app)/(tabs)/index.tsx

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}}
style={css`
bottom: 16px;
`}
/>
</Container>
);
}
11 changes: 11 additions & 0 deletions app/(app)/(tabs)/profile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {View} from 'react-native';
import {Typography} from 'dooboo-ui';
import {Stack} from 'expo-router';

Check warning on line 3 in app/(app)/(tabs)/profile.tsx

View workflow job for this annotation

GitHub Actions / build

'Stack' is defined but never used. Allowed unused vars must match /^_/u

export default function Index(): JSX.Element {
return (
<View>
<Typography.Heading3>프로필</Typography.Heading3>
</View>
);
}
75 changes: 0 additions & 75 deletions app/(app)/index.tsx

This file was deleted.

1 change: 1 addition & 0 deletions app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function Layout(): JSX.Element | null {
),
}}
>
<Stack.Screen name="(app)/(tabs)" options={{headerShown: false}} />
{/* Note: Only modals are written here. */}
</Stack>
</Content>
Expand Down
2 changes: 1 addition & 1 deletion test/app/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'react-native';
import type {RenderAPI} from '@testing-library/react-native';
import {render, waitFor} from '@testing-library/react-native';

import Page from '../../app/(app)/index';
import Page from '../../app/(app)/(tabs)/_layout';
import {createTestElement, createTestProps} from '../testUtils';

let props: any;
Expand Down

0 comments on commit 772de92

Please sign in to comment.