Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nav] Implement expo routing and add global styles #15

Merged
merged 10 commits into from
Oct 3, 2023
14 changes: 4 additions & 10 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { NavigationContainer } from '@react-navigation/native';
import TabNavigator from './src/navigation/TabNavigator';

export default function App() {
return (
<NavigationContainer>
<TabNavigator />
</NavigationContainer>
);
}
// export default function App() {
// return (
// )
// }
4 changes: 3 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"scheme": "your-app-scheme",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
Expand All @@ -23,6 +24,7 @@
},
"web": {
"favicon": "./assets/favicon.png"
}
},
"plugins": ["expo-router"]
}
}
7 changes: 1 addition & 6 deletions assets/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import { Ionicons } from '@expo/vector-icons';
import React from 'react';

export type IconType =
| 'home_outline'
| 'search_outline'
| 'document_outline'
| 'notifications_outline';
export type IconType = 'home_outline' | 'document_outline' | 'search_outline';

const IconSvgs: Record<IconType, React.ReactElement> = {
home_outline: <Ionicons name="home-outline" size={23} />,
search_outline: <Ionicons name="search-outline" size={23} />,
document_outline: <Ionicons name="document-outline" size={23} />,
notifications_outline: <Ionicons name="notifications-outline" size={23} />,
};
type Props = {
className?: string;
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ module.exports = api => {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: ['expo-router/babel'],
};
};
61 changes: 61 additions & 0 deletions globalStyles.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { StyleSheet } from 'react-native';

export default StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
alignItems: 'flex-start',
justifyContent: 'flex-start',
paddingLeft: 16,
paddingRight: 16,
},
h1: {
// fontFamily: 'DMSans-Bold',
fontSize: 50,
fontWeight: '700',
textAlign: 'left',
color: 'black',
},
h2: {
// fontFamily: 'DMSans-Bold',
fontSize: 40,
fontWeight: '400',
textAlign: 'left',
color: 'black',
},
h3: {
// fontFamily: 'DMSans-Regular',
fontSize: 33,
fontWeight: '400',
textAlign: 'left',
color: 'black',
},
h4: {
// fontFamily: 'DMSans-Regular',
fontSize: 20,
fontWeight: '500',
textAlign: 'left',
color: 'black',
},
body1: {
// fontFamily: 'DMSans-Regular',
fontSize: 12,
fontWeight: '400',
textAlign: 'left',
color: 'black',
},
body2: {
// fontFamily: 'DMSans-Regular',
fontSize: 11,
fontWeight: '400',
textAlign: 'left',
color: 'black',
},
body3: {
fontFamily: 'Avenir',
fontSize: 14,
fontWeight: '400',
textAlign: 'left',
color: 'black',
},
});
Loading