Skip to content

Commit

Permalink
styles
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzitelli committed Oct 6, 2020
1 parent 3ff2968 commit 545a953
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 42 deletions.
6 changes: 3 additions & 3 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import AntIcon from 'react-native-vector-icons/AntDesign';
import { TouchableOpacity } from 'react-native-gesture-handler';

import useStyles, { ThemedStylesFuncType } from '../utils/useStyles';
import useStyles from '../utils/useStyles';

type ButtonTitleProps = {
title: string;
Expand Down Expand Up @@ -55,12 +55,12 @@ export const ButtonIcon: React.FC<ButtonIconProps> = ({
)
}

const _styles: ThemedStylesFuncType = theme => StyleSheet.create({
const _styles = (theme: ThemeType) => StyleSheet.create({
buttonContainer: {
margin: theme.sizes.s,
},
buttonIcon: {
fontSize: 32,
fontSize: 28,
color: theme.colors.text,
},
text: {
Expand Down
4 changes: 2 additions & 2 deletions src/screens/CounterScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useNavigationButtonPress } from 'react-native-navigation-hooks/dist/hoo
import { useStores } from '../stores';
import Constants from '../utils/constants';
import { ButtonIcon } from '../components/Button';
import useStyles, { ThemedStylesFuncType } from '../utils/useStyles';
import useStyles from '../utils/useStyles';

const CounterScreen: NavigationFunctionComponent = observer(({
componentId,
Expand Down Expand Up @@ -52,7 +52,7 @@ const _styles = (theme: ThemeType) => StyleSheet.create({
alignItems: 'center',
},
text: {
fontSize: 80,
fontSize: 64,
margin: theme.sizes.s,
textAlign: 'center',
color: theme.colors.text,
Expand Down
77 changes: 40 additions & 37 deletions src/screens/ExpoScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useServices } from '../services';
import Reanimated2 from '../components/Reanimated2';
import { ButtonTitle } from '../components/Button';
import useStyles, { ThemedStylesFuncType } from '../utils/useStyles';
import { ScrollView } from 'react-native-gesture-handler';


const ExpoScreen: NavigationFunctionComponent = observer(({
Expand All @@ -42,41 +43,43 @@ const ExpoScreen: NavigationFunctionComponent = observer(({

return (
<SafeAreaView style={styles.container}>
<View style={styles.section}>
<Text style={styles.header}>
{ 'From Expo SDK' }
</Text>

<Text style={styles.text}>Device ID: {ExpoConstants.deviceId}</Text>
<Text style={styles.text}>Network type: {ui.networkType}</Text>
</View>

<View style={styles.section}>
<Text style={styles.header}>
{ 'Reanimated 2' }
</Text>

<Reanimated2 />
</View>

<View style={styles.section}>
<Text style={styles.header}>
{ 'Navigation' }
</Text>

<ButtonTitle
title={'Push this screen again'}
onPress={() => navigation.pushExpo(componentId)}
/>
<ButtonTitle
title={'Show it as a modal'}
onPress={() => navigation.showExpo()}
/>
<ButtonTitle
title={'Close modal'}
onPress={() => navigation.dismissModal(componentId)}
/>
</View>
<ScrollView>
<View style={styles.section}>
<Text style={styles.header}>
{ 'From Expo SDK' }
</Text>

<Text style={styles.text}>Device ID: {ExpoConstants.deviceId}</Text>
<Text style={styles.text}>Network type: {ui.networkType}</Text>
</View>

<View style={styles.section}>
<Text style={styles.header}>
{ 'Reanimated 2' }
</Text>

<Reanimated2 />
</View>

<View style={styles.section}>
<Text style={styles.header}>
{ 'Navigation' }
</Text>

<ButtonTitle
title={'Push this screen again'}
onPress={() => navigation.pushExpo(componentId)}
/>
<ButtonTitle
title={'Show it as a modal'}
onPress={() => navigation.showExpo()}
/>
<ButtonTitle
title={'Close modal'}
onPress={() => navigation.dismissModal(componentId)}
/>
</View>
</ScrollView>
</SafeAreaView>
);
});
Expand All @@ -90,12 +93,12 @@ const _styles = (theme: ThemeType) => StyleSheet.create({
padding: theme.sizes.m,
},
header: {
fontSize: 26,
fontSize: 24,
fontWeight: 'bold',
color: theme.colors.text,
},
text: {
fontSize: 18,
fontSize: 16,
margin: theme.sizes.s,
color: theme.colors.text,
}
Expand Down

0 comments on commit 545a953

Please sign in to comment.