Skip to content

Commit

Permalink
feat: added fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
burhanyilmaz committed Jan 7, 2024
1 parent 1261655 commit 176d470
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 2 deletions.
7 changes: 7 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { useLoadFonts } from '@hooks/useLoadFonts';
import MainNavigator from '@navigators/MainNavigator';
import { StatusBar } from 'expo-status-bar';

export default function App() {
const { loaded } = useLoadFonts();

if (!loaded) {
return null;
}

return (
<>
<StatusBar style="auto" />
Expand Down
Binary file added assets/fonts/Poppins-Bold.ttf
Binary file not shown.
Binary file added assets/fonts/Poppins-Medium.ttf
Binary file not shown.
Binary file added assets/fonts/Poppins-Regular.ttf
Binary file not shown.
Binary file added assets/fonts/Poppins-SemiBold.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = function (api) {
{
root: ['./src'],
alias: {
'@hooks': './src/hooks',
'@theme': './src/theme',
'@screens': './src/screens',
'@components': './src/components',
Expand Down
2 changes: 1 addition & 1 deletion src/components/core/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type Props = {
};

const Button = ({ title, onPress }: Props) => (
<TouchableOpacity onPress={onPress} className="px-6 py-2.5 bg-slate-500 rounded-md">
<TouchableOpacity onPress={onPress} className="px-6 py-2.5 bg-teal-600 rounded-md">
<Text className={text({ type: 'headline', isCenter: true, class: 'text-white' })}>{title}</Text>
</TouchableOpacity>
);
Expand Down
12 changes: 12 additions & 0 deletions src/hooks/useLoadFonts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { useFonts } from 'expo-font';

export const useLoadFonts = () => {
const [loaded] = useFonts({
Bold: require('../../assets/fonts/Poppins-Bold.ttf'),
Medium: require('../../assets/fonts/Poppins-Medium.ttf'),
Regular: require('../../assets/fonts/Poppins-Regular.ttf'),
SemiBold: require('../../assets/fonts/Poppins-SemiBold.ttf'),
});

return { loaded };
};
2 changes: 1 addition & 1 deletion src/screens/Test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const TestScreen = () => (
<SafeAreaView>
<View className="px-4">
<Text className={text({ type: 'title1', class: 'my-2' })}>Test Screen</Text>
<Button title="Press me!" />
<Button title="Get Your Website" />
</View>
</SafeAreaView>
);
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"strict": true,
"baseUrl": "./src",
"paths": {
"@hooks/*": ["./hooks/*"],
"@theme/*": ["./theme/*"],
"@screens/*":["./screens/*"],
"@components/*": ["./components/*"],
Expand Down

0 comments on commit 176d470

Please sign in to comment.